Thread.
More...
Thread.
Definition at line 23 of file hub_discovery.py.
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.
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.
rocon_hub_client.hub_discovery.HubDiscovery._blacklisted_hubs |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._direct_discovered_hubs |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._direct_hub_uri_list |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._discovered_hubs_modification_mutex |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._discovery_request |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._internal_sleep_period |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._last_loop_timestamp |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._list_discovered_services |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._loop_period |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._trigger_shutdown |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._zeroconf_discovered_hubs |
|
private |
rocon_hub_client.hub_discovery.HubDiscovery._zeroconf_services_available |
|
private |
string rocon_hub_client.hub_discovery.HubDiscovery.gateway_hub_service = "_ros-multimaster-hub._tcp" |
|
static |
rocon_hub_client.hub_discovery.HubDiscovery.trigger_update |
rocon_hub_client.hub_discovery.HubDiscovery.verify_connection_hook |
The documentation for this class was generated from the following file: