router – Router

Routes messages to workers (that are in named queues).

class eventmq.router.Router(*args, **kwargs)

A simple router of messages

This router uses tornado’s eventloop.

__weakref__

list of weak references to the object (if defined)

on_inform(sender, msg_id, msg)

Handles a new worker coming online

on_receive_reply(msg)

This method is called when a message comes in from the worker socket. It then calls on_command. If on_command isn’t found, then a warning is created.

def on_inform(msg):
pass
on_receive_request(msg)

This function is called when a message comes in from the client socket. It then calls on_command. If on_command isn’t found, then a warning is created.

start(frontend_addr='tcp://127.0.0.1:47290', backend_addr='tcp://127.0.0.1:47291')

Begin listening for connections on the provided connection strings

Parameters:
  • frontend_addr (str) – connection string to listen for requests
  • backend_addr (str) – connection string to listen for workers