Alternative to queue worker app bootstrapped in memory just like in octane #49954
-
https://laravel.com/docs/8.x/queues "Remember, queue workers, are long-lived processes and store the booted application state in memory. As a result, they will not notice changes in your code base after they have been started. So, during your deployment process, be sure to restart your queue workers. In addition, remember that any static state created or modified by your application will not be automatically reset between jobs." Is there a way we can change this to opcache like behavior as opposed to octane behavior? Now I realize what the comparisons between symfony and laravel meant about data clogging. queue:listen I saw has some issues with handling signals... #47444 UPDATE: How to disable caching the app in worker command? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
and taking into account this #49633
This will handle signals and execute in a loop the queue:work --once if needed and coupled with opcache and JIT it should be fast enough. |
Beta Was this translation helpful? Give feedback.
-
After 4 h of research it hit me: The daemon queue:work "stores the booted application state in memory" BECAUSE IT IS A PHP process not because the app is stored in the cache or in memory on purpose by laravel. So just restarting queue:work command will "invalidate the cached code and static variables". This should be better explained in the documentation.... So the --once option is enough and there is no need for queue:restart |
Beta Was this translation helpful? Give feedback.
After 4 h of research it hit me: The daemon queue:work "stores the booted application state in memory" BECAUSE IT IS A PHP process not because the app is stored in the cache or in memory on purpose by laravel. So just restarting queue:work command will "invalidate the cached code and static variables".
This should be better explained in the documentation....
So the --once option is enough and there is no need for queue:restart