Posts

Working with Redis queues using rmq library in Golang

Rmq : Redis Messaging Queue Github : https://github.com/adjust/rmq Section 1 : Lets look at adding new items into a Redis queue from a Go routine The following is a producer routine in Golang. It will create a queue named “things” inside the Redis server, and store items inside it. Redis implements the queue as a double-ended Queue allowing push and pop from both ends of the same queue. The items are timestamps recorded by the Go routine. package main import(         "fmt"         "time"         "strconv"         "github.com/adjust/rmq" ) func main(){         connection := rmq.OpenConnection("test_producer", "tcp","localhost:6379", 1)         things := connection.OpenQueue("things")         defer...

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...