Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
rocon_hub_client.hub_discovery.HubDiscovery Class Reference

Thread. More...

Inheritance diagram for rocon_hub_client.hub_discovery.HubDiscovery:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, verify_connection_hook, direct_hub_uri_list=[], disable_zeroconf=False, blacklisted_hubs={})
 
def disengage_hub (self, hub)
 
def run (self)
 
def shutdown (self)
 

Public Attributes

 trigger_update
 
 verify_connection_hook
 

Static Public Attributes

string gateway_hub_service = "_ros-multimaster-hub._tcp"
 

Private Member Functions

def _direct_scan (self)
 Private methods. More...
 
def _sleep (self)
 
def _zeroconf_scan (self)
 

Private Attributes

 _blacklisted_hubs
 
 _direct_discovered_hubs
 
 _direct_hub_uri_list
 
 _discovered_hubs_modification_mutex
 
 _discovery_request
 
 _internal_sleep_period
 
 _last_loop_timestamp
 
 _list_discovered_services
 
 _loop_period
 
 _trigger_shutdown
 
 _zeroconf_discovered_hubs
 
 _zeroconf_services_available
 

Detailed Description

Thread.

Definition at line 23 of file hub_discovery.py.

Constructor & Destructor Documentation

def rocon_hub_client.hub_discovery.HubDiscovery.__init__ (   self,
  verify_connection_hook,
  direct_hub_uri_list = [],
  disable_zeroconf = False,
  blacklisted_hubs = {} 
)
  :param external_discovery_update: is a callback function that takes action on a discovery
  :type external_discovery_update: GatewayNode.register_gateway(ip, port)

  :param str[] direct_hub_uri_list: list of uri's to hubs (e.g. http://localhost:6380)

  :param disallowed_hubs:
  :type disallowed_hubs: # 'ip:port' : (error_code, error_code_str) dictionary of hubs that have been blacklisted (maintained by manager of this class)

Definition at line 30 of file hub_discovery.py.

Member Function Documentation

def rocon_hub_client.hub_discovery.HubDiscovery._direct_scan (   self)
private

Private methods.

  Ping the list of hubs we are directly looking for to see if they are alive.
  Also check if the gateway there is listed to determine if the connection should be refreshed

Definition at line 164 of file hub_discovery.py.

def rocon_hub_client.hub_discovery.HubDiscovery._sleep (   self)
private
  Internal non-interruptible sleep loop to check for shutdown and update triggers.
  This lets us set a really long watch_loop update if we wish.

Definition at line 150 of file hub_discovery.py.

def rocon_hub_client.hub_discovery.HubDiscovery._zeroconf_scan (   self)
private
  This checks for new services and adds them. I'm not taking any
  action when a discovered service disappears yet though. Probably
  should take of that at some time.

Definition at line 189 of file hub_discovery.py.

def rocon_hub_client.hub_discovery.HubDiscovery.disengage_hub (   self,
  hub 
)
  Called when a discovered hub is lost in the upstream application.

  This method should remove the hub from the list of discovered hubs.
  When the hub comes back up again, the hub discovery thread will
  call the discovery_update_hook again

  @param hub: hub to be disengage
  @type Hub

Definition at line 131 of file hub_discovery.py.

def rocon_hub_client.hub_discovery.HubDiscovery.run (   self)
  The hub discovery thread worker function. Monitors zeroconf for the presence of new hubs.

  Note that the zeroconf service is persistent. Alternatively we could use the zeroconf
  subscriber to be a wee bit more efficient.

Definition at line 71 of file hub_discovery.py.

def rocon_hub_client.hub_discovery.HubDiscovery.shutdown (   self)
  Called from the main program to shutdown this thread.

Definition at line 59 of file hub_discovery.py.

Member Data Documentation

rocon_hub_client.hub_discovery.HubDiscovery._blacklisted_hubs
private

Definition at line 47 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._direct_discovered_hubs
private

Definition at line 45 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._direct_hub_uri_list
private

Definition at line 44 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._discovered_hubs_modification_mutex
private

Definition at line 54 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._discovery_request
private

Definition at line 49 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._internal_sleep_period
private

Definition at line 80 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._last_loop_timestamp
private

Definition at line 81 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._list_discovered_services
private

Definition at line 52 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._loop_period
private

Definition at line 79 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._trigger_shutdown
private

Definition at line 42 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._zeroconf_discovered_hubs
private

Definition at line 53 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery._zeroconf_services_available
private

Definition at line 46 of file hub_discovery.py.

string rocon_hub_client.hub_discovery.HubDiscovery.gateway_hub_service = "_ros-multimaster-hub._tcp"
static

Definition at line 25 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery.trigger_update

Definition at line 43 of file hub_discovery.py.

rocon_hub_client.hub_discovery.HubDiscovery.verify_connection_hook

Definition at line 41 of file hub_discovery.py.


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


rocon_hub_client
Author(s): Daniel Stonier , Jihoon Lee
autogenerated on Mon Jun 10 2019 14:40:08