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

Public Member Functions

def __init__ (self, nickname, headers)
 
def __del__ (self)
 
def stop (self)
 
def poll (self, timeout=0)
 
def drain (self)
 
def matchnick (self, nick)
 
def waitfor (self, nickname, timeout=-1)
 
def party (self, nicks, timeout=-1)
 

Public Attributes

 zyre
 
 peers
 
 poller
 

Detailed Description

Peer at the network to discover others and advertise self.

This is equivalent to C++ zio::Peer and is a wrapper around Pyre,
the Python Zyre.

Definition at line 16 of file peer.py.

Constructor & Destructor Documentation

◆ __init__()

def zio.peer.Peer.__init__ (   self,
  nickname,
  headers 
)
Create a peer with a nickname.

Extra headers may be given as a dictionary.

Definition at line 24 of file peer.py.

◆ __del__()

def zio.peer.Peer.__del__ (   self)

Definition at line 40 of file peer.py.

Member Function Documentation

◆ drain()

def zio.peer.Peer.drain (   self)
Continually poll until all queued Zyre events are processed.

Definition at line 86 of file peer.py.

◆ matchnick()

def zio.peer.Peer.matchnick (   self,
  nick 
)
Return UUIDs of all peers with matching nicks

Definition at line 93 of file peer.py.

◆ party()

def zio.peer.Peer.party (   self,
  nicks,
  timeout = -1 
)
Wait as set of nicks have been seen or until timeout.

Return a peer dictionary holding last seen info about peers
with matching nicks.

Definition at line 128 of file peer.py.

◆ poll()

def zio.peer.Peer.poll (   self,
  timeout = 0 
)
Poll the network for an update.

Return True if an event was received.  True is returned on
reception of any type of Zyre event.  Use timeout in msec to
wait for an event.

Definition at line 54 of file peer.py.

◆ stop()

def zio.peer.Peer.stop (   self)
Stop the peer.

This MUST be called or the application will hang.

Definition at line 43 of file peer.py.

◆ waitfor()

def zio.peer.Peer.waitfor (   self,
  nickname,
  timeout = -1 
)
Wait for at least one peer with the nickname to be.

Return a list of UUIDs of peers discovered to have this
nickname.

Definition at line 104 of file peer.py.

Member Data Documentation

◆ peers

zio.peer.Peer.peers

Definition at line 31 of file peer.py.

◆ poller

zio.peer.Peer.poller

Definition at line 37 of file peer.py.

◆ zyre

zio.peer.Peer.zyre

Definition at line 30 of file peer.py.


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