hammerstonedev / laravel-pseudo-daemon Goto Github PK
View Code? Open in Web Editor NEWA Laravel package to mimic daemons via scheduled commands without having to change server configuration.
A Laravel package to mimic daemons via scheduled commands without having to change server configuration.
Hi,
Gotta give it to you for this package! :)
A few things came across my mind:
Daemon
classes instead of requiring every daemon to be a command, this fills up artisan with commands which might be duplicate, especially if I prefer to keep my existing commands as just commands.$schedule->call(new DaemonClass)->everyMinute()...;
. Offhand, I think it is even backward compatible to your current approach.pseudo
got me a bit confused there, i.e. half-daemon? My suggestion here is that a clearer name can help, your brief description was quite clear though.Useful package!
Hi, I've been using this package for a few years now, and overall it's great.
However, from time to time I've experienced scenarios where I end up with multiple instances of the same pseudo-daemon running in parallel, which is unwanted. The root of the problem stems from Laravel's withoutOverlapping
functionality. By default, the method sets a cache period of 24 hours. Regardless of the time set, once the cache file expires, an additional processor is started in parallel.
In order to prevent this issue, I've ended up making the daemon process perform a chunk of work and then stop. I then base the withoutOverlapping
time, with some leeway, around an estimated time period for that chunk of work, e.g. say the work takes 45 minutes, I'll set withoutOverlapping
to 60 minutes. In rare circumstances where the processor has then taken longer than the allocated 60 minutes, a second pseudo-daemon has then kicked off, in parallel.
My reason for opening this issue is two-fold, [1] I'm either missing something when using this package; or [2] the reliance on withoutOverlapping
has an unforeseen issue.
Cannot composer require due to illuminate/support package version:
- resolute/laravel-pseudo-daemon v0.3.0 requires illuminate/support ^6.2|^7.0|^8.0 -> found illuminate/support[v6.2.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Hi,
Is there a way to make the daemon never restart? I looked at the code, I think -1 will do the job, but seems hacky :)
Hey, thanks for this package and sorry for bothering you with usage questions/feature requests.
Currently withoutOverlapping
causes this to run on a single thread only. My use case involves waiting for an API response, so I would like to have multiple pollers running simultaneously.
Could I somehow do that? At the moment the only solution seems to duplicate my commands, i.e. make poller2:work
, poller3:work
etc.
First off, thanks for a great package! Really easy to use and useful.
I'm using Forge and Envoyer, but for some reason my pseudo-daemons are not restarting after deployments. I've looked through the code and it certainly seems like it should be stopping. We use the standard /home/forge/[domain]/current convention.
I've just tested with multiple deployments but the same daemon has been running for ~30 minutes even though I deployed 4 minutes ago. The process itself only takes about 10-15 seconds to run.
Is this something you've seen before? Any idea where to look?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.