How do swoole timers run for a long time?

set the timer when judging $worker_id = = 0 in onWorkerStart. Can
guarantee that this timer will run all the time and will not quit?

Mar.03,2021

timer is best placed in the task process, because the work process is to process the request, and if the code in your timer takes up too much time, it will affect the processing of the request. The
timer keeps running as long as your workder doesn't hang up or turn off.

Menu