Description
We have a requirement to send streams of messages directly between grains - i.e., one grain sending a stream of messages directly to another grain. Furthermore, we need these streams to be particularly high performance, where the sender does not wait for acknowledgement of one message before sending another message - like with gRPC streaming requests.
We would be happy to use gRPC to stream messages between grains, but that would require being able to establish a gRPC connection from one grain to another, and that doesn't seem possible.
Sending individual messages is too slow given the latency between grains. I recognise that the messages can be batched, but that still requires each batch to be sent and processed one at a time, which means the next batch is not being sent while the previous batch is being processed.
This performance limitation also applies to Orleans streams because each stream event is delivered from the agent to consumers via the standard Orleans grain messaging - i.e., one at a time.
It would be great if a grain interface method could accept and/or return an IAsyncEnumerable<TMessage>
, or something along those lines, which Orleans then understood/interpreted as inbound/outbound message streams.