Two small experiments from the same week in July 2012.
queue-process: a Redis queue consumer#
A multithreaded C++ client that pops events from a Redis list with a blocking BLPOP and hands them to a worker. Two Boost threads share the work. A wrapper around the Redis client catches connection errors and retries every second, so the consumer survives Redis restarts. Source.
req-rep: ZeroMQ between C++ and Python#
A ZeroMQ request-reply pair. The C++ server handles three-letter commands. GET returns the current message with its ID. ACK<id> confirms it and moves on to the next one. The client is Python with Twisted and txZMQ. It loops GET and ACK, and on any failure, for example a timeout, it drops the socket and starts again. Source.