Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes
bondpy.bondpy.Bond Class Reference

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

List of all members.

Public Member Functions

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

Public Attributes

 condition
 connect_timer
 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
def _on_bond_status
def _on_connect_timeout
def _on_disconnect_timeout
def _on_heartbeat_timeout
def _publish
def _publishing_thread

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 80 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 88 of file bondpy.py.

Definition at line 183 of file bondpy.py.


Member Function Documentation

Definition at line 339 of file bondpy.py.

Definition at line 243 of file bondpy.py.

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

Definition at line 196 of file bondpy.py.

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

Definition at line 161 of file bondpy.py.

Definition at line 178 of file bondpy.py.

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

Definition at line 166 of file bondpy.py.

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

Definition at line 221 of file bondpy.py.

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

Definition at line 231 of file bondpy.py.

Breaks the bond, notifying the other process.

Definition at line 332 of file bondpy.py.

INTERNAL.

Definition at line 252 of file bondpy.py.

def bondpy.bondpy.Bond.Death (   self)

INTERNAL.

Definition at line 267 of file bondpy.py.

Definition at line 117 of file bondpy.py.

Definition at line 133 of file bondpy.py.

Definition at line 141 of file bondpy.py.

Definition at line 125 of file bondpy.py.

INTERNAL.

Definition at line 259 of file bondpy.py.

Indicates if the bond is broken.

Returns:
true iff the bond has been broken.

Definition at line 327 of file bondpy.py.

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

Sets the broken callback.

Definition at line 285 of file bondpy.py.

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

Definition at line 119 of file bondpy.py.

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

Definition at line 135 of file bondpy.py.

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

Sets the formed callback.

Definition at line 280 of file bondpy.py.

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

Definition at line 143 of file bondpy.py.

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

Definition at line 127 of file bondpy.py.

Definition at line 186 of file bondpy.py.

INTERNAL.

Definition at line 263 of file bondpy.py.

def bondpy.bondpy.Bond.start (   self)

Starts the bond and connects to the sister process.

Definition at line 150 of file bondpy.py.

INTERNAL.

Definition at line 275 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 311 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 293 of file bondpy.py.


Member Data Documentation

Definition at line 119 of file bondpy.py.

Definition at line 135 of file bondpy.py.

Definition at line 143 of file bondpy.py.

Definition at line 127 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 119 of file bondpy.py.

Definition at line 135 of file bondpy.py.

Definition at line 127 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 88 of file bondpy.py.

Definition at line 150 of file bondpy.py.

Definition at line 150 of file bondpy.py.

Definition at line 88 of file bondpy.py.


Property Documentation

Definition at line 123 of file bondpy.py.

Definition at line 139 of file bondpy.py.

Definition at line 146 of file bondpy.py.

Definition at line 131 of file bondpy.py.


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


bondpy
Author(s): Stuart Glaser
autogenerated on Sun Oct 5 2014 22:32:32