Created
April 20, 2014 21:28
-
-
Save mikewiegand/11125729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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