Webador / SlmQueue

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

[Feature] Segregating JobInterface into executable and read/writable #208

Closed boesing closed 6 years ago

boesing commented 6 years ago

Hey there,

I am actually implementing a Queue/Worker project, which should be able to deploy multiple workers on multiple machines. I would love to create a Project, which handles the queuing itself (e.g. over an API) and a worker project, which just fetches a job and executes it.

Actually, I have to configure both projects (API and Worker) to interact with the Queue and with another Project, just because I have to provide the execute method to the JobInterface even if I just want to enqueue the Job without executing it directly.

So it would be nice if we could segregate the JobInterface into ExecutableJobInterface (which provides the execute method) and an IOJobInterface (which is extended by the ExecutableJobInterface) which provides the other methods, the JobInterface actually is implementing.

That would mean, that we could change the QueueInterface::push and QueueInterface::delete method definition from JobInterface to IOJobInterface and the return value of QueueInterface::pop to ExecutableJobInterface.

What do you guys think about this? I know, this change will BC break but I think this could be pretty useful.

basz commented 6 years ago

IMO this is not a feature I would invest my time in. But if you provide a good PR I’m willing to have a look and consider it. No issues with BC.

roelvanduijnhoven commented 6 years ago

IMO this is not a feature I would invest my time in. But if you provide a good PR I’m willing to have a look and consider it. No issues with BC.

I'll close this one as it really not an issue.