You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .WithPrefetchAsync extension returns ValueTask<IAsyncEnumerable<T>> which means an async enumerator method has to change its signature (or add an overload) in order to support prefetching.
Can we do better?
The text was updated successfully, but these errors were encountered:
AArnott
changed the title
Need a way for a method returning IAsyncEnumerable<T> to support prefetching
Support IAsyncEnumerable<T> prefetch without returning Task<IAsyncEnumerable<T>>Apr 1, 2020
This allows RPC server methods to return IAsyncEnumerable<T> with a prefetch setting without requiring them to call an async method and thus have to return a `Task<IAsyncEnumerable<T>>` instead of the more preferable `IAsyncEnumerable<T>` directly.
Closesmicrosoft#430
AArnott
added a commit
to AArnott/vs-streamjsonrpc
that referenced
this issue
Apr 3, 2020
…refetch setting without requiring them to call an async method and thus have to return a `Task<IAsyncEnumerable<T>>` instead of the more preferable `IAsyncEnumerable<T>` directly.
The trick here is that the `JsonRpc` class must itself perform the asynchronous `PrefetchAsync` operation after the RPC method returns but before sending the result for transmission to the formatter.
Closesmicrosoft#430
The
.WithPrefetchAsync
extension returnsValueTask<IAsyncEnumerable<T>>
which means an async enumerator method has to change its signature (or add an overload) in order to support prefetching.Can we do better?
The text was updated successfully, but these errors were encountered: