Skip to content

OrleansContrib/Orleans.StorageProvider.Arango

Repository files navigation

Build status

ArangoDB Storage Provider for Microsoft Orleans

Can be used to store grain state in an ArangoDB database.

Installation

Install the nuget package:

PM> Install-Package Orleans.StorageProvider.Arango

Usage

Register the provider like this:

config.Globals.RegisterArangoStorageProvider("ARANGO",
    url: "http://localhost:8529",
    username: "root",
    password: "password");

Then from your grain code configure grain storage in the normal way:

// define a state interface
public class MyGrainState
{
        string Value { get; set; }
}

// Select ARANGO as the storage provider for the grain
[StorageProvider(ProviderName="ARANGO")]
public class Grain1 : Orleans.Grain<MyGrainState>, IGrain1
{
        public Task Test(string value)
        {
                // set the state and save it
                this.State.Value = value;
                return this.WriteStateAsync();
        }

}

Note:

  • Grain state can be stored using a database name of your choice. The default is 'Orleans'.
  • The state is stored in a collection named after your grain. Alternatively, you can supply a table name as an argument.

License

MIT

About

🥑 ArangoDB Storage Provider for Microsoft Orleans

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages