vortex.alive — PyVortex ALIVE module: ALIVE profile support

This modules includes all functions required to implement connection ALIVE through Vortex Library ALIVE implementation.

See notes from C API explaining how to use ALIVE API. Because this module is a binding for that API, all documentation applies:


Module API


Allows to init ALIVE module on the provided vortex.Ctx reference. This is only required at the receiving side that is, the peer that will be monitored.

Parameters:ctx (vortex.Ctx) – vortex context where ALIVE module will be initialized
Return type:True it initialization was completed, otherwise False is returned.
vortex.alive.enable_check(conn, check_period, max_unreply_count, failure_handler)

Activates the ALIVE connection check on the provided connection. The remote side must accept being monitored by calling to init(). In the case a failure_handler is provided it will be cause when the failure is found but the connection will not be closed. In the case the failure handler is not configured and a failure is found, the connection is shutted down.

  • conn (vortex.Connection) – The connection where the ALIVE process will take place.
  • check_period – The check period. It is defined in microseconds (1 second == 1000000 microseconds). To check every 20ms a* connection pass 20000. It must be > 0, or the function will return False.
  • max_unreply_count (Int) – The maximum amount of unreplied messages we accept. It must be > 0 or the function will return False.
  • failure_handler (Handler) – Optional handler called when a failure is detected.
Return type:

True it initialization was completed, otherwise False is returned.