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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ManagedCode.Orleans.Graph" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ManagedCode.Orleans.Graph --version 8.0.0                
#r "nuget: ManagedCode.Orleans.Graph, 8.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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                

img|300x200

Here's a good README for the Orleans Graph project:

Orleans Graph

NuGet version .NET CodeQL

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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