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
 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
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 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.

Definition at line 196 of file bondpy.py.


Member Function Documentation

Definition at line 361 of file bondpy.py.

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.

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.

Breaks the bond, notifying the other process.

Definition at line 355 of file bondpy.py.

INTERNAL.

Definition at line 267 of file bondpy.py.

def bondpy.bondpy.Bond.Death (   self)

INTERNAL.

Definition at line 282 of file bondpy.py.

Definition at line 126 of file bondpy.py.

Definition at line 144 of file bondpy.py.

Definition at line 153 of file bondpy.py.

Definition at line 135 of file bondpy.py.

INTERNAL.

Definition at line 274 of file bondpy.py.

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.

Definition at line 199 of file bondpy.py.

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.

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

Definition at line 129 of file bondpy.py.

Definition at line 147 of file bondpy.py.

Definition at line 156 of file bondpy.py.

Definition at line 138 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 129 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 147 of file bondpy.py.

Definition at line 138 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 94 of file bondpy.py.

Definition at line 162 of file bondpy.py.

Definition at line 162 of file bondpy.py.

Definition at line 94 of file bondpy.py.


Property Documentation

Definition at line 133 of file bondpy.py.

Definition at line 151 of file bondpy.py.

Definition at line 159 of file bondpy.py.

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 Thu Aug 17 2017 03:12:48