Thanks James, making it clear that for web devs (asp.net) it just frees up the thread for other HTTP requests is a major key. Wish I had read your article sooner :).
I started trying to use it thinking it would put the work on a background thread so the user could keep going, but it only really does that for desktop apps like you mentioned.
Better to use HostingEnvironment.QueueBackgroundWorkItem() for my purposes.
Thanks for the feedback! Async is hard. Even when you do know how to use it...
Just an extra thought - HostingEnvironment.QueueBackgroundWorkItem() still uses threads from the thread pool in web apps. Triggering many long-running background tasks could actually cause thread starvation in high-demand scenarios.
Take care Joe!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks James, making it clear that for web devs (asp.net) it just frees up the thread for other HTTP requests is a major key. Wish I had read your article sooner :).
I started trying to use it thinking it would put the work on a background thread so the user could keep going, but it only really does that for desktop apps like you mentioned.
Better to use
HostingEnvironment.QueueBackgroundWorkItem()
for my purposes.Thanks for the feedback! Async is hard. Even when you do know how to use it...
Just an extra thought -
HostingEnvironment.QueueBackgroundWorkItem()
still uses threads from the thread pool in web apps. Triggering many long-running background tasks could actually cause thread starvation in high-demand scenarios.Take care Joe!