Recently, I've moved from
queue:work, because the project consumes lots of resources on doing its main job (like syncing between external API and local DB, processing webhooks, many scheduled tasks), so, spending even more resources on bootstrapping… I don't know.
The "hacky" point, however, is that daemonized job may leak memory. So, my questions is: how do I make sure that the memory is not leaked in my jobs?
CACHE_DRIVER=file) manually? Should I null all used variables? etc. It's just a "grey area" for me, because I'm only used to write "response rapidly and die quick" kind of code :-(
2nd point: I'm also thinking about all that "full-blooded boots" when the only thing, that is expected from controller — is dispatching a job (e.g., processing a webhook). Maybe, there's a solution to put a new job into queue (I'm using DB driver for jobs) without loading Laravel? I'm thinking of a stand-alone PHP script with very little footprint here.