Problem/Motivation
It's difficult for contrib or custom modules to instrument the queue system for performance monitoring purposes (or, to otherwise respond to jobs being queued or processed).
Steps to reproduce
Attempt to respond or "hook into" to queue operations, e.g. install modules/libraries that enable performance tracing and attempt to create performance tracing spans for queue operations.
Proposed resolution
Dispatch events for queue operations, e.g. ItemQueuing, ItemQueued, ItemProcessing, ItemExceptionOccurred, ItemProcessed.
Note, however, that queue processing may be re-implemented by Drush, contrib modules (e.g. ultimate_cron), etc. In the current architecture, each implementation would be responsible for correctly dispatching the events.
Remaining tasks
Review feature request and develop a merge request.
User interface changes
None.
Introduced terminology
None.
API changes
New events would be added to the queue API.
Data model changes
None.
Comments
Comment #2
volegerComment #4
chi commentedThere might be performance issue when you enqueue hundreds items.
Comment #5
mfbPerformance issues is exactly what this feature would allow us to analyze.. :)
Firing an event should be far lighter weight than a database insert query.
If performance was affected though, then we could always disable queue events by default and provide a means to enable them.