Orleans two way communication between grain client and grain
<p>I would like to implement a callback to a grain client inside a grain method Eg. during evaluation of Grain.Method1 a client method needs to be called to get some data. </p>

<p>I've tried to do so with streams, but when I subscribe the stream on client, the method does not fire. </p>

<p>Grain: </p>

<pre><code>var config = ClusterConfiguration.LocalhostPrimarySilo();
config.AddMemoryStorageProvider();
config.Globals.RegisterStorageProvider&lt;MemoryStorage&gt;("PubSubStore");
config.Globals.RegisterStreamProvider&lt;SimpleMessageStreamProvider&gt;("MySMSProvider");
...
public override async Task OnActivateAsync() {
var streamProvider  = GetStreamProvider("MySMSProvider");
var stream = streamProvider.GetStream&lt;MyTypeMessage&gt;(myGuid, "MyStream");

RegisterTimer(s =&gt; {
   return stream.OnNextAsync(new MyTypeMessage());
}, null, TimeSpan.FromMilliseconds(1000), TimeSpan.FromMilliseconds(1000));
...
</code></pre>

<p>Client: </p>

<pre><code>var clientConfiguration = ClientConfiguration.LocalhostSilo();
clientConfiguration.RegisterStreamProvider&lt;SimpleMessageStreamProvider&gt;("MySMSProvider");
GrainClient.Initialize(clientConfiguration);
...
var streamProvider = GrainClient.GetStreamProvider("MySMSProvider");
var stream = requestStreamProvider.GetStream&lt;MyTypeMessage&gt;(myGuid, "MyStream");
await stream.SubscribeAsync(
            async (message, token) =&gt; { process message that does not fire }); 
</code></pre>