Webador / SlmQueue

Laminas / Mezzio module that integrates with various queue management systems.
Other
138 stars 57 forks source link

Allow pushing a job instance via the controller plugin #210

Closed roelvanduijnhoven closed 6 years ago

roelvanduijnhoven commented 6 years ago

The controller plugin that comes with this repo does not allow to push a job by instance.

This PR adds that functionality in the following way:

$this->queue()->pushJob(SendSlackMessage::create('@me', 'Hello'), ['delay' => 3]);

Curious to hear what you think about this one @basz and @bakura10.

basz commented 6 years ago

IMO this should be the preferred method to add jobs as it prevents Dependency injection which is only required for execution.

That would be a BC so I that is a step too far but I welcome this PR

roelvanduijnhoven commented 6 years ago

I updated the PR to make the syntax tests pass.

IMO this should be the preferred method to add jobs as it prevents Dependency injection which is only required for execution. That would be a BC so I that is a step too far but I welcome this PR.

True. So for now let's merge this. And think of a way how we can better promote usage of the tools we have. That is an interesting topic. That also briefly touches https://github.com/juriansluiman/SlmQueue/issues/84.