GithubHelp home page GithubHelp logo

ResqueScheduler into Fresque about fresque HOT 10 CLOSED

wa0x6e avatar wa0x6e commented on August 22, 2024
ResqueScheduler into Fresque

from fresque.

Comments (10)

wa0x6e avatar wa0x6e commented on August 22, 2024

You can't (yet). The methods are from the dependencies, but not implemented yet. It's in my todo list

from fresque.

mrjgreen avatar mrjgreen commented on August 22, 2024

Okay thanks.

from fresque.

pwhelan avatar pwhelan commented on August 22, 2024

I had a working patch (which I nuked) that allowed invoking ResqueScheduler by setting the binary for the queue. The resulting queue definition I had was this:

[Qeueus]

... 

_schdlr_[workers] = 1
_schdlr_[interval] = 15
_schdlr_[bin] = ./resque-scheduler

I'll reimplement the patch now and do a pull request. If someone has a more elegant solution that would be nice but this should work for now.

from fresque.

wa0x6e avatar wa0x6e commented on August 22, 2024

It's not what I had in mind. My goal is to have something similar to https://github.com/kamisama/Cake-Resque/blob/master/Console/Command/CakeResqueShell.php#L420

from fresque.

pwhelan avatar pwhelan commented on August 22, 2024

Would the idea then to have a special INI settings specifically for invoking Resque-Scheduler then? Should I work on that and add it to the Fresque section? Like so would be my idea then:

[Fresque]
...
; Invoke the scheduler
scheduler = true

The resque-scheduler binary could be searched out relative to the autoload path upon loading. I can give it a try tomorrow.

from fresque.

wa0x6e avatar wa0x6e commented on August 22, 2024

My goal is to have the same thing on Fresque and CakeResque, same settings, etc ... to preserve compatibility between these 2 scripts. Fresque is just a generic version of CakeResque.

from fresque.

pwhelan avatar pwhelan commented on August 22, 2024

I had not even looked at your implementation for CakeResque. Would it work then to include a new section specifically for the Scheduler?

The format (from what I gather) would be:

[Scheduler]
enabled = true ; false (default)
log = /tmp/resque-scheduler.log ; default to using the fresque log?
user = apache
env[some] = envvariable
env[and] = someothervariable
lib = ./vendor/kamisama/php-resque-ex
interval = 5 ; should I bother make this a part of a subsection of sorts?
loghandler = Cube
loghandlertarget = udp://127.0.0.1:1180

The actual LOGHANDLER and LOGHANDLERTARGET should be the same as the other workers, should it not? The case could be made to expose them as sub settings in the same way as env?

Another alternative to make it almost entirely compatible, but also extremely loooong winded.

[Scheduler]
enabled = true ; false (default)
log = /tmp/resque-scheduler.log ; default to using the fresque log?
Env[some] = envvariable
Env[and] = someothervariable
; add the other bit of the path and expose as RESQUE_PHP to the binary
lib = ./vendor/kamisama/php-resque-ex
; I could see these settings just being a direct key off of [Scheduler]
Worker[interval] = 5
Worker[user] = apache
; This would probably need to be it's own section, unless we could live
; with LOGHANDLERTARGET and LOGHANDLER, which would make more sense
; for fresque.ini
Log[target] = udp://127.0.0.1:1180
Log[handler] = Cube

Any further thoughts?

from fresque.

pwhelan avatar pwhelan commented on August 22, 2024

I'll do a pull request for variant #1 and we can see where we go from there.

from fresque.

wa0x6e avatar wa0x6e commented on August 22, 2024

If you don't mind, I'm working on it now. I prefer to have something very close to the original CakeResque implementation to keep the compatibility.

from fresque.

wa0x6e avatar wa0x6e commented on August 22, 2024

Check the latest master.

Update composer dependencies with composer update, then enable the scheduler in the .ini file in the [Scheduler] section.

You can then start the scheduler worker with fresque startScheduler.

from fresque.

Related Issues (20)

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.