Message-passing for everyone.
I proudly announce libchirp. I believe queues, message-routers and patterns like pub-sub are the way message-passing should be done. However, I also believe they should be optional and tweak-able. libchirp does only one thing: message-passing with encryption. All other building-blocks should be implemented in upper-layer modules or daemons. libchirp is the basis for modular message-passing and actor-based programming.
Here the mandatory echo-server example:
import asyncio from libchirp.asyncio import Chirp, Config, Loop class EchoChirp(Chirp): async def handler(self, msg): await self.send(msg) loop = Loop(); config = Config() config.DISABLE_ENCRYPTION = True # Workers are usually asynchronous config.SYNCHRONOUS = False aio_loop = asyncio.get_event_loop() try: chirp = EchoChirp(loop, config, aio_loop) try: aio_loop.run_forever() finally: chirp.stop() finally: loop.stop()
By the way libchirp for python are bindings to my C99-implementation. My secondary goal is to build a polyglot message-passing toolkit. Please be welcome to contribute bindings for your favorite language.