Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes | List of all members
bondpy.bondpy.Bond Class Reference

Forms a bond to monitor another process. More...

Inheritance diagram for bondpy.bondpy.Bond:
Inheritance graph
[legend]

Public Member Functions

def __del__ (self)
 
def __init__ (self, topic, id, on_broken=None, on_formed=None)
 Constructs a bond, but does not connect. More...
 
def __repr__ (self)
 
def break_bond (self)
 Breaks the bond, notifying the other process. More...
 
def Connected (self)
 INTERNAL. More...
 
def Death (self)
 INTERNAL. More...
 
def get_connect_timeout (self)
 
def get_disconnect_timeout (self)
 
def get_heartbeat_period (self)
 
def get_heartbeat_timeout (self)
 
def Heartbeat (self)
 INTERNAL. More...
 
def is_broken (self)
 Indicates if the bond is broken. More...
 
def set_broken_callback (self, on_broken)
 Sets the broken callback. More...
 
def set_connect_timeout (self, dur)
 
def set_disconnect_timeout (self, dur)
 
def set_formed_callback (self, on_formed)
 Sets the formed callback. More...
 
def set_heartbeat_period (self, per)
 
def set_heartbeat_timeout (self, dur)
 
def shutdown (self)
 
def SisterDied (self)
 INTERNAL. More...
 
def start (self)
 Starts the bond and connects to the sister process. More...
 
def StartDying (self)
 INTERNAL. More...
 
def wait_until_broken (self, timeout=None)
 Blocks until the bond is broken for at most 'duration'. More...
 
def wait_until_formed (self, timeout=None)
 Blocks until the bond is formed for at most 'duration'. More...
 

Public Attributes

 condition
 
 connect_timer
 
 deadline
 
 disconnect_timer
 
 heartbeat_timer
 
 id
 
 instance_id
 
 is_shutdown
 
 lock
 
 on_broken
 
 on_formed
 
 pending_callbacks
 
 pub
 
 sister_died_first
 
 sister_instance_id
 
 sm
 
 sub
 
 thread
 
 topic
 

Properties

 connect_timeout = property(get_connect_timeout, set_connect_timeout)
 
 disconnect_timeout = property(get_disconnect_timeout, set_disconnect_timeout)
 
 heartbeat_period = property(get_heartbeat_period, set_heartbeat_period)
 
 heartbeat_timeout = property(get_heartbeat_timeout, set_heartbeat_timeout)
 

Private Member Functions

def _flush_pending_callbacks (self)
 
def _on_bond_status (self, msg)
 
def _on_connect_timeout (self)
 
def _on_disconnect_timeout (self)
 
def _on_heartbeat_timeout (self)
 
def _publish (self, active)
 
def _publishing_thread (self)
 

Private Attributes

 __connect_timeout
 
 __disconnect_timeout
 
 __heartbeat_period
 
 __heartbeat_timeout
 
 __started
 

Detailed Description

Forms a bond to monitor another process.

The Bond class implements a bond, allowing you to monitor another process and be notified when it dies. In turn, it will be notified when you die.

Definition at line 86 of file bondpy.py.

Constructor & Destructor Documentation

def bondpy.bondpy.Bond.__init__ (   self,
  topic,
  id,
  on_broken = None,
  on_formed = None 
)

Constructs a bond, but does not connect.

Parameters
topicThe topic used to exchange the bond status messages.
idThe ID of the bond, which should match the ID used on the sister's end
on_brokencallback that will be called when the bond is broken.
on_formedcallback that will be called when the bond is formed.

Definition at line 94 of file bondpy.py.

def bondpy.bondpy.Bond.__del__ (   self)

Definition at line 196 of file bondpy.py.

Member Function Documentation

def bondpy.bondpy.Bond.__repr__ (   self)

Definition at line 361 of file bondpy.py.

def bondpy.bondpy.Bond._flush_pending_callbacks (   self)
private

Definition at line 258 of file bondpy.py.

def bondpy.bondpy.Bond._on_bond_status (   self,
  msg 
)
private

Definition at line 212 of file bondpy.py.

def bondpy.bondpy.Bond._on_connect_timeout (   self)
private

Definition at line 172 of file bondpy.py.

def bondpy.bondpy.Bond._on_disconnect_timeout (   self)
private

Definition at line 191 of file bondpy.py.

def bondpy.bondpy.Bond._on_heartbeat_timeout (   self)
private

Definition at line 177 of file bondpy.py.

def bondpy.bondpy.Bond._publish (   self,
  active 
)
private

Definition at line 236 of file bondpy.py.

def bondpy.bondpy.Bond._publishing_thread (   self)
private

Definition at line 246 of file bondpy.py.

def bondpy.bondpy.Bond.break_bond (   self)

Breaks the bond, notifying the other process.

Definition at line 355 of file bondpy.py.

def bondpy.bondpy.Bond.Connected (   self)

INTERNAL.

Definition at line 267 of file bondpy.py.

def bondpy.bondpy.Bond.Death (   self)

INTERNAL.

Definition at line 282 of file bondpy.py.

def bondpy.bondpy.Bond.get_connect_timeout (   self)

Definition at line 126 of file bondpy.py.

def bondpy.bondpy.Bond.get_disconnect_timeout (   self)

Definition at line 144 of file bondpy.py.

def bondpy.bondpy.Bond.get_heartbeat_period (   self)

Definition at line 153 of file bondpy.py.

def bondpy.bondpy.Bond.get_heartbeat_timeout (   self)

Definition at line 135 of file bondpy.py.

def bondpy.bondpy.Bond.Heartbeat (   self)

INTERNAL.

Definition at line 274 of file bondpy.py.

def bondpy.bondpy.Bond.is_broken (   self)

Indicates if the bond is broken.

Returns
true iff the bond has been broken.

Definition at line 350 of file bondpy.py.

def bondpy.bondpy.Bond.set_broken_callback (   self,
  on_broken 
)

Sets the broken callback.

Definition at line 300 of file bondpy.py.

def bondpy.bondpy.Bond.set_connect_timeout (   self,
  dur 
)

Definition at line 129 of file bondpy.py.

def bondpy.bondpy.Bond.set_disconnect_timeout (   self,
  dur 
)

Definition at line 147 of file bondpy.py.

def bondpy.bondpy.Bond.set_formed_callback (   self,
  on_formed 
)

Sets the formed callback.

Definition at line 295 of file bondpy.py.

def bondpy.bondpy.Bond.set_heartbeat_period (   self,
  per 
)

Definition at line 156 of file bondpy.py.

def bondpy.bondpy.Bond.set_heartbeat_timeout (   self,
  dur 
)

Definition at line 138 of file bondpy.py.

def bondpy.bondpy.Bond.shutdown (   self)

Definition at line 199 of file bondpy.py.

def bondpy.bondpy.Bond.SisterDied (   self)

INTERNAL.

Definition at line 278 of file bondpy.py.

def bondpy.bondpy.Bond.start (   self)

Starts the bond and connects to the sister process.

Definition at line 162 of file bondpy.py.

def bondpy.bondpy.Bond.StartDying (   self)

INTERNAL.

Definition at line 290 of file bondpy.py.

def bondpy.bondpy.Bond.wait_until_broken (   self,
  timeout = None 
)

Blocks until the bond is broken for at most 'duration'.

Parameters
timeoutMaximum duration to wait. If None then this call will not timeout.
Returns
true iff the bond has been broken, even if it has never been formed.

Definition at line 330 of file bondpy.py.

def bondpy.bondpy.Bond.wait_until_formed (   self,
  timeout = None 
)

Blocks until the bond is formed for at most 'duration'.

Parameters
timeoutMaximum duration to wait. If None then this call will not timeout.
Returns
true iff the bond has been formed.

Definition at line 308 of file bondpy.py.

Member Data Documentation

bondpy.bondpy.Bond.__connect_timeout
private

Definition at line 131 of file bondpy.py.

bondpy.bondpy.Bond.__disconnect_timeout
private

Definition at line 149 of file bondpy.py.

bondpy.bondpy.Bond.__heartbeat_period
private

Definition at line 158 of file bondpy.py.

bondpy.bondpy.Bond.__heartbeat_timeout
private

Definition at line 140 of file bondpy.py.

bondpy.bondpy.Bond.__started
private

Definition at line 95 of file bondpy.py.

bondpy.bondpy.Bond.condition

Definition at line 114 of file bondpy.py.

bondpy.bondpy.Bond.connect_timer

Definition at line 132 of file bondpy.py.

bondpy.bondpy.Bond.deadline

Definition at line 105 of file bondpy.py.

bondpy.bondpy.Bond.disconnect_timer

Definition at line 150 of file bondpy.py.

bondpy.bondpy.Bond.heartbeat_timer

Definition at line 141 of file bondpy.py.

bondpy.bondpy.Bond.id

Definition at line 97 of file bondpy.py.

bondpy.bondpy.Bond.instance_id

Definition at line 98 of file bondpy.py.

bondpy.bondpy.Bond.is_shutdown

Definition at line 102 of file bondpy.py.

bondpy.bondpy.Bond.lock

Definition at line 113 of file bondpy.py.

bondpy.bondpy.Bond.on_broken

Definition at line 100 of file bondpy.py.

bondpy.bondpy.Bond.on_formed

Definition at line 101 of file bondpy.py.

bondpy.bondpy.Bond.pending_callbacks

Definition at line 109 of file bondpy.py.

bondpy.bondpy.Bond.pub

Definition at line 124 of file bondpy.py.

bondpy.bondpy.Bond.sister_died_first

Definition at line 103 of file bondpy.py.

bondpy.bondpy.Bond.sister_instance_id

Definition at line 99 of file bondpy.py.

bondpy.bondpy.Bond.sm

Definition at line 111 of file bondpy.py.

bondpy.bondpy.Bond.sub

Definition at line 165 of file bondpy.py.

bondpy.bondpy.Bond.thread

Definition at line 167 of file bondpy.py.

bondpy.bondpy.Bond.topic

Definition at line 96 of file bondpy.py.

Property Documentation

bondpy.bondpy.Bond.connect_timeout = property(get_connect_timeout, set_connect_timeout)
static

Definition at line 133 of file bondpy.py.

bondpy.bondpy.Bond.disconnect_timeout = property(get_disconnect_timeout, set_disconnect_timeout)
static

Definition at line 151 of file bondpy.py.

bondpy.bondpy.Bond.heartbeat_period = property(get_heartbeat_period, set_heartbeat_period)
static

Definition at line 159 of file bondpy.py.

bondpy.bondpy.Bond.heartbeat_timeout = property(get_heartbeat_timeout, set_heartbeat_timeout)
static

Definition at line 142 of file bondpy.py.


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


bondpy
Author(s): Stuart Glaser
autogenerated on Wed Mar 20 2019 07:55:37