public async Task InitAsync() { //configure the client with proper cluster options, logging and clustering ClientBuilder builder = new ClientBuilder(); builder .UseLocalhostClustering() .Configure <ClusterOptions>(options => { options.ClusterId = "dev"; options.ServiceId = "HelloWorldApp"; }) .ConfigureLogging(logging => { /*logging.AddConsole();*/ }); // add message stream provider ClientStreamExtensions.AddSimpleMessageStreamProvider(builder, "TestStream"); client = builder.Build(); await client.Connect(); // subscribe stream Guid guid = Guid.NewGuid(); // call grains from the initialized client var friend = client.GetGrain <ITestStream>(0); var response = await friend.RegisterStream(guid); Console.WriteLine("\n\n{0}\n\n", response); var streamProvider = client.GetStreamProvider("TestStream"); var stream = streamProvider.GetStream <string>(guid, "Test"); await stream.SubscribeAsync(testObserver); }
public void Plug(string proxyHost, int proxyPort) { ClientStreamExtensions.Plug(this, proxyHost, proxyPort); }
public void Plug(string host, int port) { ClientStreamExtensions.Plug(this, host, port); }