Events:
- Task is added to cron
- Task is removed from cron

Actions:
- Run cron (if it's currently running, cool)
- Stop cron (if it's currently stopped, cool)

Reasons:
Job queue seems like a great real-time queue. Here's an example of how this could be done, when a 'send email' action runs, mailq module adds it to job_queue. Even though job_queue is waiting for cron, we can also trigger a cron run as well. Thus the user who triggers the action doesn't need to wait for the email to be sent for his page to load, and the email is "immediately" dispatched.

On top of this, Cron Multi-Threading could greatly improve the speed and efficiency of handling lists of actions by prioritizing the jobs.

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Active » Closed (won't fix)

I don't think triggering a cron-run is so simple - probably this would be fine to go in the poormanscron module, as it does that already. However I wouldn't suggest postponing things to cron, which shouldn't be postponed.. ;)

@actions: Cron should be configured to run always and can't be controlled by actions. But yes, jobqueue is useful and some rules integration for it probably makes sense. I use it already with workflow-ng on a site, but an action internally makes use of it. So I'm not sure this should be "configurable" as things would be getting complicated, perhaps it's better for that to stay in code.

mitchell’s picture

Status: Closed (won't fix) » Closed (duplicate)

So cron wasn't the right idea, but job queue is a useful buffer.

Marking this as a duplicate of #423834: Integrate Job Queue with Rules.