Closed jeremyquinton closed 10 years ago
:+1: on better docs. I was already thinking of the docs while v0.4 was tagged, but it never made it...
What happens now:
EVENT_PROCESS_QUEUE
triggers the ProcessQueue strategy.EVENT_PROCESS_IDLE
is triggered.EVENT_PROCESS_JOB
is triggered whereafter a default attached listener calls the processJob()
on the worker.So you have these cases:
EVENT_PROCESS_QUEUE_PRE
, now use EVENT_PROCESS_QUEUE
with a high priority (>1)EVENT_PROCESS_QUEUE_POST
, now use EVENT_PROCESS_QUEUE
with a negative priority (<1, preferably <0)EVENT_PROCESS_JOB_PRE
now use EVENT_PROCESS_JOB
with a high priority (>1)EVENT_PROCESS_JOB_POST
, now use EVENT_PROCESS_JOB
with a negative priority (<1, preferably <0)With v0.4 the docs on events have been rewritten, but I haven't even read it yet. If you have any improvements, I would be really happy if you could write those down in a PR.
it's a still bit awkward a.t.m. event naming and the flow of events. I would hope we can get a solid design for that anytime soon. But that needs some collaboration. The docs on event should describe the current behavior pretty ok.
EVENT_PROCESS_QUEUE could be considered for internal use. Listened to by the ProcessQueueStrategy, which triggers EVENT_PROCESS_IDLE and EVENT_PROCESS_JOB.
Thanks very much for the reply. Your response has cleared things up for me. I think what you have for the event system here is really good and I probably could have done a better job at reading the docs. I read over the docs twice and dont think I can improve them much they are pretty good.
Just to clarify,
For point 2
If you used EVENT_PROCESS_QUEUE_POST, now use EVENT_PROCESS_QUEUE with a negative priority (<1, preferably <0)
Should be EVENT_FINISH
Using EVENT_FINISH
, do I still need to use a negative priority?
nope that is not required. Same for EVENT_BOOTSTRAP by the way.
Thanks :+1:
From version 0.3.* to 0.4.0 some events were removed. A previous developer bound to the events so he could log when an event went on the queue and when it was popped off the queue and also when a worker stops and starts.
I had to upgrade slmQueue to 0.4.0 for a new feature but Im not sure which events to now listen for. If you could let me know I can do a PR for the documentation. This is a BC break that will affect other developers that were using those events.