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:
use static instead of self
make QueueMonitor::TIMESTAMP_EXACT_FORMAT protected
add in configuration file a setting to choose which QueueMonitor class we want to use (as for Monitor model)
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 theQueueMonitor::handleJobProcessing()
is written like that :self::jobStarted()
. So even if I extended the QueueMonitor class,handleJobProcessing
will call the parent'sjobStarted
method.Proposed solution: Give the possibility to rewrite QueueMonitor and configure events listeners. For the QueueMonitor class:
static
instead ofself
QueueMonitor::TIMESTAMP_EXACT_FORMAT
protected