This is a feature request. I may implement it, but I am looking for input before I make an attempt.
Currently, Grains can return Task & Task<T> to consumers. This represents the asynchronous nature of distributed systems programming well and encapsulates the possibility of failure. Task<T> is restricted to returning only a single value, though.
Ideally, Grains should be able to return IObservable<T> or IAsyncObservable<T> (depending on whether or not back-pressure/ack is required) in addition to Task & Task<T>.
This differs from the Virtual Streams offered by Orleans in a few ways:
- Observables are temporary (like tasks), Streams are eternal (like grains)
- Observables are 1:1 by default, Streams may be many:many
- Observables can take parameters, Streams are identified by
(type, key).
Semantics:
- Observable methods are invoked on
SubscribeAsync, not when the client obtains the IAsyncObservable<T>.
- Silo failures are propagated to observers through
OnErrorAsync. Clients can at that point re-SubscribeAsync, at which point the grain method is invoked again.
Any obvious issues which aren't covered here?
Input is be greatly appreciated :)
This is a feature request. I may implement it, but I am looking for input before I make an attempt.
Currently, Grains can return
Task&Task<T>to consumers. This represents the asynchronous nature of distributed systems programming well and encapsulates the possibility of failure.Task<T>is restricted to returning only a single value, though.Ideally, Grains should be able to return
IObservable<T>orIAsyncObservable<T>(depending on whether or not back-pressure/ack is required) in addition toTask&Task<T>.This differs from the Virtual Streams offered by Orleans in a few ways:
(type, key).Semantics:
SubscribeAsync, not when the client obtains theIAsyncObservable<T>.OnErrorAsync. Clients can at that point re-SubscribeAsync, at which point the grain method is invoked again.Any obvious issues which aren't covered here?
Input is be greatly appreciated :)