The Best Way to Implement Long Running Tasks in .NET - Hangfire, Blazor, SignalR

  Рет қаралды 14,737

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 37
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Get the source code for this video for FREE → the-dotnet-weekly.ck.page/long-running-tasks Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@Curlack
@Curlack 6 ай бұрын
Would really love to see how to implement a cancel button utilizing the CancellationToken. Also monitoring multiple requests from the same button or even keeping it disabled 'till cancelled or completed. Those are the parts I usually croak 😅. Good job dude!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Huh, that would've been interesting. Maybe in a future video. The cancellation token would only make sense in the blocking scenario.
@Jamabaiz
@Jamabaiz 6 ай бұрын
​@@MilanJovanovicTechor in the hangfire job, if it is processing via loop, it could check cancelation token state from singleton service. User could then send request to trigger cancelation token using other endpoint which would inject this singleton service.
@vscode-runaways
@vscode-runaways 4 ай бұрын
@@MilanJovanovicTech IMO also in none blocking situations, what if you generate a n report and after a while you decide to cancel the job
@baranacikgoz
@baranacikgoz 6 ай бұрын
Excellent video, excellent approach. I love comparisons showing improvements one by one
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Awesome, glad you enjoyed it 😁
@xaloiqq
@xaloiqq 6 ай бұрын
Nice video. I think it would be a good idea to show the network tab on developer tools to explicitly show request being made in polling and signalR solutions. Keep the good work man :)
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
How didn't I think of that? Darn it... Great idea. Didn't even cross my mind. That's how often I work with Ui stuff 😅
@vscode-runaways
@vscode-runaways 4 ай бұрын
Please if you update this video add a Server Side Rendering variant to it, would be nice to see how to update the WebPage than, please also add Cancel Button to the 2nd and 3rd Szenario
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
Great suggestion!
@anasmustafa7188
@anasmustafa7188 6 ай бұрын
nice work, which theme you use for vs it make code cleaner
@MilanJovanovicTech
@MilanJovanovicTech 5 ай бұрын
ReSharper
@ZuvielDrama
@ZuvielDrama 6 ай бұрын
Thanks Milan ❤❤❤
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Sure thing!
@10Totti
@10Totti 6 ай бұрын
Best tutorial!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Wow, thanks!
@MarcelPopescu
@MarcelPopescu 5 ай бұрын
🎯 Key Takeaways for quick navigation: 00:00 *The video demonstrates three implementations for executing long-running background jobs from a Blazor WebAssembly client.* 00:14 *Version 1: A blocking implementation that waits for the entire background job duration, simulating a 10-second delay.* 04:14 *Version 2: An asynchronous implementation using Hangfire to enqueue a background job and polling the server for job status updates.* 08:24 *The client sends a POST request to enqueue the job, receives the job ID, and periodically polls the server for job status until completion.* 12:47 *Version 3: An asynchronous implementation using Hangfire and SignalR for real-time job status updates from the server.* 15:22 *The client establishes a SignalR connection, and the server pushes job status notifications through the SignalR hub.* 17:25 *Version 3 is more complex but optimizes resource utilization by eliminating unnecessary polling requests.* 17:40 *Additional benefits include the ability to retry failed jobs and resume from the last checkpoint.* Made with HARPA AI
@MilanJovanovicTech
@MilanJovanovicTech 5 ай бұрын
Pretty cool use case for AI
@shakhriyorakhadov8244
@shakhriyorakhadov8244 6 ай бұрын
Milan your thinking images hitting me up😅
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Oh gosh
@yogij17
@yogij17 6 ай бұрын
SignalR doesnt work with load balancer
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Or is hard to configure?
@amitkumdixit
@amitkumdixit 6 ай бұрын
It's better to use Hangfire dashboard instead
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
What for?
@coding-in
@coding-in 3 ай бұрын
Hi ​@@MilanJovanovicTech, what's the name feature if we use Quatrz Scheduler? Is it have a feature like that? Thanks for ur every videos!
@DIoxide-ck8uy
@DIoxide-ck8uy 6 ай бұрын
Hangfire uses a ton of cpu on my dedicated server
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
A lot of polling
@YehorBachurinDev
@YehorBachurinDev 6 ай бұрын
Nice
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Thanks!
@PankajNikam
@PankajNikam 6 ай бұрын
Is the same possible with Quartz? Thanks for the video.
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Not really, I haven't found a way to schedule background jobs on-demand with Quartz. Maybe there is and I'm just a noob, so don't take this at face value.
@PankajNikam
@PankajNikam 6 ай бұрын
@@MilanJovanovicTech Someone would be a fool to call you an amateur :) I too didn't find a way to schedule on demand job with it. I thought maybe Milan knows :)
@Wouldntyouliketoknow2
@Wouldntyouliketoknow2 5 ай бұрын
You can schedule on demand background jobs with "stint". Give it a go, I'd welcome the feedback..
CECS 475 Lab Assignment 3 Part 2
1:44
Kobe Banouvong
Рет қаралды 13
آموزش asp.net core - آپلود فایل
12:08
برنامه نویسی با دیاکد
Рет қаралды 32
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 57 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 133 МЛН
Exceptions Are Extremely Expensive… Do This Instead
17:15
Milan Jovanović
Рет қаралды 47 М.
Completely Get Rid of Exceptions Using This Technique
19:24
Milan Jovanović
Рет қаралды 26 М.
Real-Time Notifications Using Blazor and SignalR from scratch
19:43
Milan Jovanović
Рет қаралды 38 М.
The Only .NET Scheduler You Should Be Using!
16:38
Nick Chapsas
Рет қаралды 55 М.
Learn RAG, LangChain, Vector DB's, with this project, FULL COURSE
1:29:21
PropTech Founder
Рет қаралды 1,9 М.
Build a Chat with SignalR & Blazor WebAssembly in .NET 8 🚀
23:01
Avoiding long running HTTP API requests.
7:24
CodeOpinion
Рет қаралды 17 М.
What's New in .NET 9 with Examples
25:02
Nick Chapsas
Рет қаралды 45 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН