thephpleague / tactician-bernard

Tactician integration with the Bernard queueing library
MIT License
19 stars 3 forks source link

Use QueueFactory instead of specific Queue #7

Closed sagikazarmark closed 9 years ago

sagikazarmark commented 9 years ago

Currently a specific queue object is required in the consumer. Thinking about passing a queue factory in the ctor, and accepting a string queue name in the consume method.

rosstuck commented 9 years ago

Hmm... could work.

If the main script wanted to loop over different queues by name though, it could just as easily grab 'em from the QueueFactory and pass them in as they are now, which gives us a tighter, cleaner API. We could always create a helper class for that in the future anyways. I feel like there'd be some extra behavior folks might want to add there anyways, such as priority or routing etc, which we could allow by replacing that helper class rather than the core consumer.

sagikazarmark commented 9 years ago

I think priority should rather be a concern of the backend. Most of them support it.

Actually I am thinking about closing this for a while as the original idea was that by creating a queue object we have to create a factory first, so skipping this step could be a simplification. But I realised that creating a queue object is as easy as a factory.

Also, if we are going to use the "native" consumer then this becomes invalid.

sagikazarmark commented 9 years ago

See #9

sagikazarmark commented 9 years ago

Became invalid