Background Jobs in ASP.NET Core

preview_player
Показать описание
There are many different ways to do scheduled tasks or tasks that run independently from a user interface. But sometimes you just need a simple task that runs in the background of an application.

In this video, we will look at Background Jobs in ASP.NET Core, including how to create them, how to run them, and when they can be useful.

Рекомендации по теме
Комментарии
Автор

Thanks for all you do Tim, you are a blessing to C# developers and software engineers in general

ayarasimeon
Автор

I always love your approach and simplicity. My friends are tired of me because of how I advocate for your contents 😂

nosaanthony
Автор

I like ingesting these skills in small bites like this.

bmiller
Автор

That's super handy to have built right into ASP.

webluke
Автор

"You are awesome. I am highly grateful to you. I am a developer because of you. Thank you so much for your tremendous work."

MohdRizwan-pfex
Автор

Most excellent simple and concise tutorial. Thanks

VitorCosta-pbhx
Автор

Tim, I have a video idea. I'm training a new hire, and they asked me a good question I think other could benefit from. The long and short of it is F12. How to look into a class to see the available methods, and how to look at what the returns look like i.e. node<int>, and the overload options without doing the hover and up down arrows when you hover over a method.

And I've always wondered why there is a .ToString(), but there isn't a .ToInt32(). Why do I have to use Convert.ToInt32... go

Ny_babs
Автор

If anyone is using Timer, I want to warn you that when deploying an application on linux the Timer class will not work correctly, Timer will only run once. It took me a long time to find this bug!!!

АлексейОрёл-ку
Автор

Thank you, Tim! It's what i've been looking for

clebersondot-net
Автор

Thank you so much for knowledge sharing and God bless you and your family

lyudmilpetrov
Автор

I know this is just for training purposes, however there was no need to dispose the timer in a dispose method, you could just dispose it in the stop method as you create a new instance in the start method.
Great material though, thanks.

mohammedelsuissey
Автор

Excellent. I will use this approach to return the amount sent by the user from their account to another destination account at another bank or financial institution and the transaction failed for whatever reason. Therefore, the process of returning the amount to the original account will be automatic, since there will be a process running in the background verifying the result of the transfer.

carlos.maradiaga
Автор

the best never rest thank you Corey <3

Pro-sjkh
Автор

The issue I faced was the app pool will be stopped if there were no incomming requests for some time. The background tasks will also stop in this case. I tried to fix it on a app pool settings level but gave up and hosted my background workers under win service. Is there a good way to keep the app always on?

AlexanderBelikov
Автор

Excellent video as always, thanks Tim! Question: What is the best way, in your opinion, to trigger a user initiated background task, for e.g. from a web page?

VishalTrivediB
Автор

I assume with any background job technology Hangfire, Quartz, Hosted Service etc. if the IIS process isnt running then neither is your job. I used Quartz fairly recently and the job just wasnt running until i visited a page to trigger the process. Ultimate ly I abandoned it and refactored everything into a Windows Service.

andyhb
Автор

Any particular reason why we would use HostedService over the newer BackgroundService?

camelpilot
Автор

Great, what is the extension are you using to implement suggestions please?

sigma
Автор

Maybe cover Hangfire (and then Quartz!) in the nearish future?

GaryJohnWalker
Автор

Timer uses separate thread, so it breaks DI container and EF will not work (can't use already existing context). No way to use the video to access the database, agree with @AndreSilveira1.

DoYourForm