zf-fr / zfr-eb-worker

ZfrEbWorker is a thin layer to simplify the usage of SQS queues and Elastic Beanstalk environments
MIT License
8 stars 2 forks source link

Support a pipeline of middlewares to handle a message #14

Closed danizord closed 8 years ago

danizord commented 8 years ago

I managed to build a pipeline without Zend\Stratigility dependency. Yes the code is a bit hard to understand but I'm pretty confident it works (not tested yet).

The only drawback I can find of this approach is that it does not support Stratigility's error handling stuff (passing the 3rd $error argument to $next).

Should I drop it and add Stratigility dependency instead?

bakura10 commented 8 years ago

Just thought about it, but a nice side-effect of this is that we won't need Event Manager anymore. If an app needs to do more things on an event, it just needs to register an additional middleware :D.

danizord commented 8 years ago

Just thought about it, but a nice side-effect of this is that we won't need Event Manager anymore. If an app needs to do more things on an event, it just needs to register an additional middleware :D.

Kind of, we just need to make sure that some middleware will not return response without calling $next.

danizord commented 8 years ago

@bakura10 done!

PS: I'm deeply sorry to have not used Stratigility to dispatch the pipeline. Testing this stuff was the hardest thing ever :o

bakura10 commented 8 years ago

Looks good. Thanks! :)