-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Asynchronous subscribe callback #639
Comments
I've considered this in the past, but ultimately: the library has no
interest in the continuation and has no need to await it. it doesn't care
about the result and can't do anything useful with an exception. I wonder
whether this is actually a case when an `async void` might be appropriate?
(These are few and far between)
…On 2 Jun 2017 12:03 a.m., "BrennanConroy" ***@***.***> wrote:
Currently you can pass in an Action to Subscribe and SubscribeAsync
We would like to be able to pass in an asynchronous Action i.e. Func<Task>
callback that gets awaited in StackExchange.Redis.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#639>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABDsG1n7Mxd-E7V4RMPyVD581cY7Yqeks5r_0M5gaJpZM4NtpgE>
.
|
@mgravell For sequential subs, how do you pause the subscription without blocking a thread? The usual response is to offload to a queue, but the problem with that is if there are too many pending events to fit into a queue. |
I also have that same question. I'm changing our implementation back to async void as I feel like I could be contributing to thread pool exhaustion with the current GetAwaiter().GetResult(). Do you have any suggestions? |
I'm marking as v2, not as a promise, but that we'll take a hard look at this along with the other API additions and changes. |
The entire concept of an async task here only makes sense in the "everything in sequence" ( So; on the latter: this is implemented in v2; you need to use a slightly different API:
The |
Including v2 API mentioned in #639 for both synchronous and asynchronous handlers.
Including v2 API mentioned in StackExchange#639 for both synchronous and asynchronous handlers.
Including v2 API mentioned in StackExchange#639 for both synchronous and asynchronous handlers.
Including v2 API mentioned in StackExchange#639 for both synchronous and asynchronous handlers.
Including v2 API mentioned in StackExchange#639 for both synchronous and asynchronous handlers.
Currently you can pass in an
Action
toSubscribe
andSubscribeAsync
We would like to be able to pass in an asynchronous Action i.e.
Func<Task>
callback that gets awaited in StackExchange.Redis.The text was updated successfully, but these errors were encountered: