public HelloWorldController(IClusterClient clusterClient) { this.clusterClient = clusterClient; //Initialize the grains that the controller instance will use helloGrain = this.clusterClient.GetGrain <IHello>(new Guid()); goodbyeGrain = this.clusterClient.GetGrain <IGoodbye>(new Guid()); }
static void Main(string[] args) { using (ChannelFactory <IHello> channelFactoryHello = new ChannelFactory <IHello>("helloService")) using (ChannelFactory <IGoodbye> channelFactoryGoodbye = new ChannelFactory <IGoodbye>("goodbyeService")) { IHello helloProxy = channelFactoryHello.CreateChannel(); IGoodbye goodbyeProxy = channelFactoryGoodbye.CreateChannel(); Console.WriteLine(helloProxy.SayHello("Zhang San")); Console.WriteLine(goodbyeProxy.SayGoodbye("Li Si")); } }