Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thread or Task for long running operation

I need to have a thread in my app that will be long running (it is a job scheduler, Cron like) and will be most of the time sleeping. So not much CPU and IO. What would you advise me for this . Does a Task with long running option is the proper way to handle this or should I rely on the old fashion Thread and let that thread lives its own life?

like image 301
Dave Avatar asked Feb 28 '26 03:02

Dave


1 Answers

A Task with the long running option is fine. It will create a new Thread in the background and you don't have to bother about the details.

like image 147
user1908061 Avatar answered Mar 01 '26 21:03

user1908061