Skip to content

Instantly share code, notes, and snippets.

@mikewiegand
Created April 20, 2014 21:28
Show Gist options
  • Save mikewiegand/11125729 to your computer and use it in GitHub Desktop.
Save mikewiegand/11125729 to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
// The Orleans silo environment is initialized in its own app domain in order to more
// closely emulate the distributed situation, when the client and the server cannot
// pass data via shared memory.
AppDomain hostDomain = AppDomain.CreateDomain("OrleansHost", null, new AppDomainSetup
{
AppDomainInitializer = InitSilo,
AppDomainInitializerArguments = args,
});
Orleans.OrleansClient.Initialize("DevTestClientConfiguration.xml");
var userGuid = Guid.Parse("42783519-d64e-44c9-9c29-399e3afaa625");
var grain1 = PersistState.Interfaces.UserGrainFactory.GetGrain(userGuid);
grain1.UpdateName("Joanne Smith");
var name1 = grain1.GetName().Result;
var grain2 = PersistState.Interfaces.UserGrainFactory.GetGrain(userGuid);
var name2 = grain2.GetName().Result;
Console.WriteLine("Orleans Silo is running.\nPress Enter to terminate...");
Console.ReadLine();
hostDomain.DoCallBack(ShutdownSilo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment