ManagedCode.Orleans.Graph
8.0.0
Prefix Reserved
dotnet add package ManagedCode.Orleans.Graph --version 8.0.0
NuGet\Install-Package ManagedCode.Orleans.Graph -Version 8.0.0
<PackageReference Include="ManagedCode.Orleans.Graph" Version="8.0.0" />
paket add ManagedCode.Orleans.Graph --version 8.0.0
#r "nuget: ManagedCode.Orleans.Graph, 8.0.0"
// Install ManagedCode.Orleans.Graph as a Cake Addin #addin nuget:?package=ManagedCode.Orleans.Graph&version=8.0.0 // Install ManagedCode.Orleans.Graph as a Cake Tool #tool nuget:?package=ManagedCode.Orleans.Graph&version=8.0.0
Here's a good README for the Orleans Graph project:
Orleans Graph
A library for managing and validating grain call transitions in Microsoft Orleans applications. It allows you to define allowed communication patterns between grains and enforce them at runtime.
Features
- Define allowed grain-to-grain communication patterns
- Validate grain call transitions at runtime
- Detect and prevent circular dependencies
- Support for method-level granularity
- Reentrancy control
- Client-to-grain call validation
Installation
dotnet add package ManagedCode.Orleans.Graph
Usage
Configure Silo
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.Method(a => a.MethodA1(), b => b.MethodB1())
.And()
.AllowClientCallGrain<GrainA>();
});
Configure Client
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.AllMethods()
.And()
.AllowClientCallGrain<GrainA>();
});
Example
Here are more examples of how to configure the graph in your Orleans application:
Example 1: Simple Grain-to-Grain Transition
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.AllMethods();
});
Example 2: Method-Level Transition
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.Method(a => a.MethodA1(), b => b.MethodB1());
});
Example 3: Allowing Reentrancy
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.WithReentrancy()
.AllMethods();
});
Example 4: Multiple Transitions
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.AllMethods()
.And()
.AddGrainTransition<GrainB, GrainC>()
.AllMethods();
});
Example 5: Client-to-Grain Call Validation
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AllowClientCallGrain<GrainA>()
.And()
.AddGrainTransition<GrainA, GrainB>()
.AllMethods();
});
Example 6: Detecting and Preventing Circular Dependencies
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrainTransition<GrainA, GrainB>()
.AllMethods()
.And()
.AddGrainTransition<GrainB, GrainC>()
.AllMethods()
.And()
.AddGrainTransition<GrainC, GrainA>()
.AllMethods();
});
Example 7: Simple Self-Call
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrain<IGrainA>()
.WithReentrancy();
});
Example 8: Self-Call with All Methods
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrain<IGrainA>()
.AllMethods()
.WithReentrancy();
});
Example 9: Self-Call with Specific Method and Parameters
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrain<IGrainA>()
.Method(a => a.MethodA1(GraphParam.Any<int>()))
.WithReentrancy();
});
Example 10: Self-Call with Client Call Validation
builder.AddOrleansGraph()
.CreateGraph(graph =>
{
graph.AddGrain<IGrainA>()
.AllowClientCallGrain()
.WithReentrancy();
});
These examples demonstrate various ways to configure a grain to call itself, including method-level granularity, reentrancy, and client call validation.
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you have any questions or run into issues, please open an issue on the GitHub repository.
Created and maintained by ManagedCode
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.CodeAnalysis.CSharp (>= 4.11.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.11.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Orleans.Runtime (>= 8.2.0)
- Microsoft.Orleans.Sdk (>= 8.2.0)
- Microsoft.Orleans.Serialization.Abstractions (>= 8.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.0 | 76 | 11/20/2024 |