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
I'm expecting events behavior from PubSub, i.e. if I publish an event, somebody will catch it eventually (or not) and do what needs to be done. I was really surprised that it waits for all handlers to finish, i.e. Publish won't return until all handlers are done.
PubSub.Hub.Default.Subscribe<MyObj>(async c =>
{
await Task.Delay(TimeSpan.FromSeconds(10));
});
await PubSub.Hub.Default.PublishAsync(new MyObj());
var t = 1; // We reach this line only after the delay func is finished, i.e. in 10 seconds.
I would excpect that the above code behaves like this:
PubSub.Hub.Default.Subscribe<MyObj>(c =>
{
_ = Task.Run(async () => await Task.Delay(TimeSpan.FromSeconds(10)));
});
await PubSub.Hub.Default.PublishAsync(new MyObj());
var t = 1; // We reach this line immideatelly. Handler task will be finished at some point in time.
The text was updated successfully, but these errors were encountered:
I'm expecting events behavior from PubSub, i.e. if I publish an event, somebody will catch it eventually (or not) and do what needs to be done. I was really surprised that it waits for all handlers to finish, i.e. Publish won't return until all handlers are done.
I would excpect that the above code behaves like this:
The text was updated successfully, but these errors were encountered: