romanzipp / Laravel-Queue-Monitor

Monitoring Laravel Jobs with your Database
https://packagist.org/packages/romanzipp/laravel-queue-monitor
MIT License
698 stars 92 forks source link

[Enhancement] QueueMonitor overriding #112

Closed kira0269 closed 1 year ago

kira0269 commented 1 year ago

I started to use this package and I'm facing the following case : I want to monitor job when they are added to the queue, not just when they start. I wanted to override QueueMonitor class, but I can't do it easily unless I copy it and rewrite it. I also had to deactivate package auto discovering to override the provider in order to modify the events listeners.

For exemple: I have to override QueueMonitor::jobStarted() in order to not create a Monitor model, but to update it. But the QueueMonitor::handleJobProcessing() is written like that : self::jobStarted(). So even if I extended the QueueMonitor class, handleJobProcessing will call the parent's jobStarted method.

Proposed solution: Give the possibility to rewrite QueueMonitor and configure events listeners. For the QueueMonitor class:

AsemAlalami commented 1 year ago

FYI, currently the package supports monitoring queued jobs

romanzipp commented 1 year ago

Will be shortly released in version 5.0