Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Asynchronous Rx implementation #435

Merged
merged 331 commits into from
Mar 2, 2018
Merged

[WIP] Asynchronous Rx implementation #435

merged 331 commits into from
Mar 2, 2018

Conversation

bartdesmet
Copy link
Collaborator

This pull request contains an initial implementation of "Async Rx" with the following essential interfaces:

  • IAsyncObservable<T>, the dual to IAsyncEnumerable<T> and the async variant of IObservable<T>
  • IAsyncObserver<T>, the dual to IAsyncEnumerator<T> and the async variant of IObserver<T>
  • IAsyncSubject<T>, the async variant of ISubject<T>
  • IAsyncDisposable, the async variant of IDisposable
  • IAsyncScheduler, the async variant of IScheduler

Note that this PR is work in progress. While it has most operators implemented, there's some outstanding design work and a ton of testing to be done. The main goals of this initial PR are:

  • research the duality with the latest "async streams" proposal in C# 8.0;
  • get a feel for the APIs and the overload bloat for async variants;
  • noodle around with different implementation techniques, e.g. observer operators;
  • give the resulting prototype a spin in practice.

Interface variants would be possible with regards to supporting CancellationToken parameters, but it brings similar pains as the ones observed (pun intended) by the LDM for the C# 8.0 design of async streams. As such, this initial implementation uses a "cancellation agnostic" approach, though further study is warranted.

In the context of Rx, the use of CancellationToken in various places clearly shows the pain these induce on top of the algebra of sequences, e.g. any cancellation of an On*Async call leaves observers in indeterminate states, so termination of the subscription is warranted, which indicates that the IAsyncDisposable handle to the subscription and any CancellationTokens for event flow aren't orthogonal. Similar concerns occur when attempt to cancel the creation of a subscription.

While more fine-grained control over cancellation can be useful for service abstractions of Rx (as done in the "Reactor" project in Bing) that cross I/O boundaries, such distributed abstractions could be regarded as being layered on top (i.e. we don't need a "one size fits all" interface necessarily). In fact, other orthogonal requirements are imposed in the distributed variants, such as the ability to pass in explicit identifiers for resources. More on that another time.

@BigBabay
Copy link

Hi, great job, want to use it in our project. Can you answer, how long time acceptance of PR can take?

@pekkah
Copy link

pekkah commented Feb 19, 2018

Any news on this?

@bartdesmet
Copy link
Collaborator Author

Merging this initial prototype as-is, with future development planned after IAsyncEnumerable<T> is set in stone and the interface duality can be re-evaluated.

@bartdesmet bartdesmet merged commit dda12ff into develop Mar 2, 2018
@ramonsmits
Copy link

@bartdesmet Is the develop branch part of a nightly? It seems https://github.com/Reactive-Extensions/Rx.NET/tree/develop/AsyncRx.NET will be a new package?

@petroemil
Copy link

@bartdesmet would you be able to provide any news on the development of these set of features and/or potentially the progress of opening up Reactor to the public?

@17-09
Copy link

17-09 commented Jul 10, 2019

Any news about Asynchronous Rx implementation in 2019?

@clairernovotny clairernovotny deleted the AsyncRx branch August 19, 2019 14:01
@pihai
Copy link

pihai commented Sep 8, 2020

Any news about Asynchronous Rx implementation in 2020?

@casperOne
Copy link

2022 perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants