ZIO
Python and C++ interface to ZeroMQ and Zyre
Public Member Functions | Public Attributes | List of all members
zio.flow.broker.Broker Class Reference

Public Member Functions

def __init__ (self, server, factory)
 
def poll (self, timeout=None)
 
def stop (self)
 

Public Attributes

 server
 
 factory
 
 other
 
 handlers
 

Detailed Description

Definition at line 15 of file broker.py.

Constructor & Destructor Documentation

◆ __init__()

def zio.flow.broker.Broker.__init__ (   self,
  server,
  factory 
)
Create a flow broker.

Parameters
----------
server : zio.Port
    An online SERVER port
factory : callable
    See below

This broker routes messages between a pair of clients: a
remote client and its handler.  It does this by adding a flow
initiation protocol to ZIO flow protocol.

On receipt of a BOT, the broker passes it to the factory which
should return True if the BOT was accepted else None.  The
factory call should return as promptly as possible as the
broker blocks.

If factory returns True then it is expected that the factory
has started some other client which contacs the broker with
the BOT.  The factory or the new client may modify the BOT as
per flow protorocl but must leave intact the `cid` attribute
placed in the flow object by the broker.

Note that the flow handler protocol does not communicate the
location of the broker's SERVER socket.  It is up to handler
implementations to locate the the server.

Definition at line 16 of file broker.py.

Member Function Documentation

◆ poll()

def zio.flow.broker.Broker.poll (   self,
  timeout = None 
)
Poll for at most one message from the SERVER port

Raises exceptions.

Definition at line 51 of file broker.py.

◆ stop()

def zio.flow.broker.Broker.stop (   self)

Definition at line 126 of file broker.py.

Member Data Documentation

◆ factory

zio.flow.broker.Broker.factory

Definition at line 47 of file broker.py.

◆ handlers

zio.flow.broker.Broker.handlers

Definition at line 49 of file broker.py.

◆ other

zio.flow.broker.Broker.other

Definition at line 48 of file broker.py.

◆ server

zio.flow.broker.Broker.server

Definition at line 46 of file broker.py.


The documentation for this class was generated from the following file: