Top Level Management

Resource management class that exposes a single local peer.

This class can be executed both as a thread and as an online worker if current thread has nothing to do. When used as a thread call start() and it will perform the necessary steps. When used online call run().

To see some other router-dealer patterns goto: - [http://hintjens.com/blog:42]

p2p0mq.app.local_peer.LocalPeer.name

The name of the thread.

Type:str
p2p0mq.app.local_peer.LocalPeer.config

Configuration options loaded at startup.

Type:dict
p2p0mq.app.local_peer.LocalPeer.zmq_monitor

Brings together all monitoring sockets.

Type:zmq.Poller
p2p0mq.app.local_peer.LocalPeer.zmq_context

The zmq resource management structure.

Type:zmq.Context
p2p0mq.app.local_peer.LocalPeer.receiver

The server of the local peer. It runs on a separate thread and has a distinct web address.

Type:Receiver
p2p0mq.app.local_peer.LocalPeer.sender

The client used by local peer. It runs on a separate thread and has a distinct web address.

Type:Sender
p2p0mq.app.local_peer.LocalPeer.daemon

A boolean value indicating whether this thread is a daemon thread.

This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.

The entire Python program exits when no alive non-daemon threads are left.

p2p0mq.app.local_peer.LocalPeer.ident

Thread identifier of this thread or None if it has not been started.

This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.

p2p0mq.app.local_peer.LocalPeer.name

A string used for identification purposes only.

It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.

p2p0mq.app.local_peer.LocalPeer.uuid

Unique identifier for this peer.