Skip to content

Support returning IAsyncObservable<T> from Grain methods #940

@ReubenBond

Description

@ReubenBond

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:

  1. Observables are temporary (like tasks), Streams are eternal (like grains)
  2. Observables are 1:1 by default, Streams may be many:many
  3. 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 :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions