Building the shipping service

In our small e-commerce example, we are still missing the shipping service. In real-world scenarios, this would be a really complex task, and you would often need to communicate with outside parties and maybe integrate with APIs of external transport service providers. For this reason, we will now build our shipping service as a worker pool using PUSH and PULL sockets and an arbitrary number of worker processes.

PUSH/PULL for beginners

A PUB socket publishes each message to all connected subscribers. ZeroMQ also offers the PUSH and PULL socket types - they work similar to PUB/SUB, but each message published on a PUSH socket is sent to only one of potentially many connected PULL sockets. You can use this to implement ...

Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.