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

Support Async Duplex Only #36

Open
RxDave opened this issue Jan 9, 2019 · 0 comments
Open

Support Async Duplex Only #36

RxDave opened this issue Jan 9, 2019 · 0 comments

Comments

@RxDave
Copy link
Owner

RxDave commented Jan 9, 2019

Notifications from clients arrive on I/O completion ports. Blocking these threads causes deadlocks and/or severe performance penalties. Therefore, allowing clients to close over enumerables, or synchronous functions of any kind within their queries MUST not be permitted. Testing these features over the years has often resulted in deadlocks and unexpected behavior, and frankly it's much harder to debug a client query with them in place.

Furthermore, considering all of the great async support that has come to be since having written this framework, it only makes sense to avoid sync callbacks altogether.

Therefore, only the following scenarios SHOULD be supported:

  1. Closing over any IObservable<T>, or any type that implements IObservable<T> (e.g., Subject<T>)
  2. Closing over any local function that returns IObservable<T>, or any type that implements it.
    a. Note that this is acceptable because the function call from the server to the client can be async since an observable proxy can be created on the server. After all, the call to Subscribe is inherently async, thus the server can continue executing the query and call Subscribe on the proxy observable, while the duplex mechanism asynchronously sends the invoke message to the client and calls Subscribe on the client-side.
  3. Closing over any Task or Task<T>.
  4. Closing over any local function that returns a Task or Task<T>.
  5. Closing over any IAsyncEnumerable<T> -- (For future consideration).
  6. Closing over any local function that returns IAsyncEnumerable<T> -- (For future consideration).
@RxDave RxDave self-assigned this Jan 9, 2019
@RxDave RxDave pinned this issue Jan 9, 2019
@RxDave RxDave removed their assignment Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant