Posts

Showing posts from September, 2017

A discussion on how to create a fast, non-blocking messaging bus in Python.

The discussion here is to try and create a message bus, which is : 1. fast 2. simple 3. scalable 4. language agnostic 5. does not change order of received packets We will work here with Python. Python is a loosely typed language, easy to learn, great to code, and perfect to demo new ideas. Day 1: Lets use something thats already there in the market. Pyee ( https://github.com/jfhbrook/pyee )  is an open library created with the intention of event emission. It transfers messages based on "skills". What it basically does is to associate pre-defined handlers for a given skill. When a packet with a skill is "emitted", all the handlers who were associated with this particular skill are all invked one after another. This gives the feeling of transferring the message from the current context to the context of the handlers, effectively passing the message. In a short program here, I will try to demonstrate what happens in the whole cycle. Assume, thread1 is an e...