GithubHelp home page GithubHelp logo

hammerstonedev / laravel-pseudo-daemon Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 12.0 35 KB

A Laravel package to mimic daemons via scheduled commands without having to change server configuration.

PHP 100.00%

laravel-pseudo-daemon's People

Contributors

aarondfrancis avatar grantjanecek avatar tontonsb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-pseudo-daemon's Issues

Some suggestions

Hi,

Gotta give it to you for this package! :)
A few things came across my mind:

  1. I think it is better to have 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.
  2. Laravel's example is to call it this way $schedule->call(new DaemonClass)->everyMinute()...;. Offhand, I think it is even backward compatible to your current approach.
  3. Technically, it is still a daemon, just that the way it is started is "different", 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!

Multiple instances of pseudo-daemon running in parallel.

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.

Upgrade to Laravel 9.x

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.

Running multiple daemons in parallel?

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.

Not restarting when deploying with Envoyer

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.