laravel queues - how sync driver works? Does it executes in a seperated process or the main execution thread?

前端 未结 2 1944
谎友^
谎友^ 2020-12-15 07:51

I am sending push notifications from my server and want it to simply be executed in a background process. I\'ve read the Laravel docs and I know about database driver and so

相关标签:
2条回答
  • 2020-12-15 08:45

    Queue sync run in same thread with http request or thread now. Deamon not run, i will use sync queue in local test, yo use dd(), show all data to screen

    0 讨论(0)
  • 2020-12-15 08:48

    After some research, I've decided to go with database driver. There are some other great options as well, but the choice will depend on your system workload.

    The point is, sync driver uses the main thread for execution of tasks which is useful for only when you are in development. If you have a production system then you might need to consider some other option to run your queue. The main idea of queuing long-running tasks is to be able to execute them in some background process so your main application thread won't block and you can serve your client requests more quickly.

    For further information on different drivers and help please visit Laravel docs

    0 讨论(0)
提交回复
热议问题