Job Queue is a great module that would make some rules' actions performance friendly by adding function calls to a queue that is run on cron (thinking of mail to users of role...)
Why not have rules actions check if module jobqueue exists and then call :
job_queue_add($function, $description, $arguments = array(), $file = '', $no_duplicate = FALSE)
Or maybe add a checkbox on Action Form that says "queue this action on cron run".
What do you think ?
Comments
Comment #1
mitchell commentedDiscussion over at job queue: #423834: Integrate Job Queue with Rules.
Comment #2
redben commented@opensanta I saw the discussion at job queue (bye the way great a module!) before posting on rules issue queue. The reason i post this feature request here is that i think that if somethink should be done it is here and not on jobqueue, because it is rules that is going to be using a feature on job queue.
What are your thoughts ?
Comment #3
mitchell commentedhttp://drupal.org/project/drupal_queue
Comment #4
fagoYep, that sounds useful. Not sure whether it should ship with rules though. Queue is in core, so from that point it should. However this is more an advanced feature which shouldn't confuse starters.
Comment #5
YK85 commentedsubscribing
Comment #6
mitchell commentedAnother issue with similar goals and UX considerations: #89181: Use queue API for node and comment, user, node multiple deletes
Comment #7
7wonders commentedThis would be very handy as sometimes a rule being called will jam up other processes if the action is a lengthy one. For example, I had a rule being called on creation of nodes through a rest service with services 3, the rule was to perform some custom module imports, reverse geo lookups and other stuff through an execute php code action, so it takes some time. This prevented the rest response from being sent and giving timeout responses. SO, instead of sending the parameters directly to the custom module I sent them to a queue:
Then the job is done on cron instead.
Im pretty sure someone smarter than myself could put together a generic version of this so that different actions could be sent to "rules action queues" that are handled on cron.
Comment #8
bojanz commentedVBO allows you to enqueue a rules component on any number of entities.
Comment #9
mitchell commentedMarked #1405430: Queue mail registration using rules as a duplicate.
Comment #10
mitchell commentedActually, Queue API integration is already provided by Rules Scheduler. The problem is that, even though it can be used to solve use cases like #7 and #1695018: Flag Javascript Toggle extremely slow with Rules, it's likely to be missed.
Perhaps, we could either try to solve this in
rules_scheduler.infoat the name and/or description, to make the availability of this functionality more obvious, or maybe in the same spirit of #1495718: Add option to convert a set of conditions or actions to a component, we could add an option to components in the actions list to "Convert to a scheduled operation" or "Convert to a queued operation". The effect would be to replace the "Evaluate component [x]" with the "Schedule a component for evaluation".I think one major focus to consider is where/how we can replace the verb 'schedule' with 'queue'.
Comment #11
mitchell commentedMarking this as a duplicate of #1780484: Rename Scheduler to Queue Scheduler per #10.