Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.43 KB

readme.md

File metadata and controls

56 lines (40 loc) · 1.43 KB

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