Add Queue.Job.* lifecycle events with optional Sentry bridge #453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds generic queue job lifecycle events with an optional bridge for Sentry integration. This is an alternative to PRs #449 and #452, providing a middle-ground approach.
Generic Events
The plugin now dispatches standard lifecycle events:
Queue.Job.created- when a job is added to the queueQueue.Job.started- when a worker begins processing a jobQueue.Job.completed- when a job finishes successfullyQueue.Job.failed- when a job fails (with exception data)These events are useful for any monitoring, logging, or external integration.
Optional Sentry Integration
For lordsimal/cakephp-sentry integration, users can register the included
CakeSentryEventBridge:This bridges the generic events to
CakeSentry.Queue.*events that the Sentry plugin listens to.Key Benefits
Related Issues
Test plan
Queue.Job.createdeventQueue.Job.startedeventQueue.Job.completedeventQueue.Job.failedeventCakeSentryEventBridgelistener