Using Task with Raise
See original GitHub issueMy event handlers run async code.
When I raise my event handlers, I’m in an async context, so I can easily await
.
What are your thoughts on a WeakEventSourceAsync
with a Task Raise(object sender, TEventArgs e)
?
edit: Typo with signature.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
c# - How to raise an event inside a Task?
How to raise an event inside a Task? · 1. Yes, see blog.stephencleary.com/2012/02/… · The TPL is a way of managing asynchronous operations...
Read more >Event Raise Task
The Event-Raise task represents the location of a user-defined event. A user-defined event is the sequence of tasks in the branch from the ......
Read more >Using the Event-Raise Task for a User-Defined Event
In the Workflow Designer workspace, create an Event-Raise task and place it in the workflow to represent the user-defined event you want to...
Read more >Task-based asynchronous programming - .NET
In this article, learn about task-based asynchronous programming through the Task Parallel Library (TPL) in .NET.
Read more >Advanced Tips for Using Task.Run with Async/Await
Let's dive deeper into using Task.Run with Async/Await and determine whether or not we should use Task.Run with ASP.NET Core.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue has been resolved in release 3.1.0-beta.1.
Thanks again, @pauldotknopf!
BTW, I tried to refactor to share some of the code between the sync and async implementations, but couldn’t find a good way to do it. If you look at the diff between the two files, there are very few differences, but they’re usually either on the return type (
void
vsTask
, andvoid
can’t be used as a generic type parameter), or the use ofawait
, which can’t easily refactored.Hey @pauldotknopf, I just realized I had never released a stable version with this change… Sorry about that. I just published 3.1.0.
There should also be a 4.0.0 coming soon, with a few breaking changes.