All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends
Public Member Functions | Public Attributes | Properties | Private Member Functions | Private Attributes
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 81 of file bondpy.py.


Constructor & Destructor Documentation

def 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 89 of file bondpy.py.

def bondpy.Bond.__del__ (   self)

Definition at line 184 of file bondpy.py.


Member Function Documentation

def bondpy.Bond.__repr__ (   self)

Definition at line 340 of file bondpy.py.

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

Definition at line 244 of file bondpy.py.

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

Definition at line 197 of file bondpy.py.

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

Definition at line 162 of file bondpy.py.

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

Definition at line 179 of file bondpy.py.

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

Definition at line 167 of file bondpy.py.

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

Definition at line 222 of file bondpy.py.

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

Definition at line 232 of file bondpy.py.

def bondpy.Bond.break_bond (   self)

Breaks the bond, notifying the other process.

Definition at line 333 of file bondpy.py.

def bondpy.Bond.Connected (   self)

INTERNAL.

Definition at line 253 of file bondpy.py.

def bondpy.Bond.Death (   self)

INTERNAL.

Definition at line 268 of file bondpy.py.

Definition at line 118 of file bondpy.py.

Definition at line 134 of file bondpy.py.

Definition at line 142 of file bondpy.py.

Definition at line 126 of file bondpy.py.

def bondpy.Bond.Heartbeat (   self)

INTERNAL.

Definition at line 260 of file bondpy.py.

def bondpy.Bond.is_broken (   self)

Indicates if the bond is broken.

Returns:
true iff the bond has been broken.

Definition at line 328 of file bondpy.py.

def bondpy.Bond.set_broken_callback (   self,
  on_broken 
)

Sets the broken callback.

Definition at line 286 of file bondpy.py.

def bondpy.Bond.set_connect_timeout (   self,
  dur 
)

Definition at line 120 of file bondpy.py.

def bondpy.Bond.set_disconnect_timeout (   self,
  dur 
)

Definition at line 136 of file bondpy.py.

def bondpy.Bond.set_formed_callback (   self,
  on_formed 
)

Sets the formed callback.

Definition at line 281 of file bondpy.py.

def bondpy.Bond.set_heartbeat_period (   self,
  per 
)

Definition at line 144 of file bondpy.py.

def bondpy.Bond.set_heartbeat_timeout (   self,
  dur 
)

Definition at line 128 of file bondpy.py.

def bondpy.Bond.shutdown (   self)

Definition at line 187 of file bondpy.py.

def bondpy.Bond.SisterDied (   self)

INTERNAL.

Definition at line 264 of file bondpy.py.

def bondpy.Bond.start (   self)

Starts the bond and connects to the sister process.

Definition at line 151 of file bondpy.py.

def bondpy.Bond.StartDying (   self)

INTERNAL.

Definition at line 276 of file bondpy.py.

def 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 312 of file bondpy.py.

def 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 294 of file bondpy.py.


Member Data Documentation

Definition at line 120 of file bondpy.py.

Definition at line 136 of file bondpy.py.

Definition at line 144 of file bondpy.py.

Definition at line 128 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 120 of file bondpy.py.

Definition at line 136 of file bondpy.py.

Definition at line 128 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 89 of file bondpy.py.

Definition at line 151 of file bondpy.py.

Definition at line 151 of file bondpy.py.

Definition at line 89 of file bondpy.py.


Property Documentation

Definition at line 124 of file bondpy.py.

Definition at line 140 of file bondpy.py.

Definition at line 147 of file bondpy.py.

Definition at line 132 of file bondpy.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


bondpy
Author(s): Stuart Glaser
autogenerated on Thu Aug 15 2013 10:10:41