Package rocon_hub_client :: Module hub_discovery :: Class HubDiscovery
[frames] | no frames]

Class HubDiscovery

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        HubDiscovery

Instance Methods
 
__init__(self, external_discovery_update_hook, direct_hub_uri_list=[], disable_zeroconf=False)
@param external_discovery_update is a callback function that takes action on a discovery @type gateway_node.update_discovery_hook(ip, port)
source code
 
shutdown(self)
Called from the main program to shutdown this thread.
source code
 
run(self)
The hub discovery thread worker function.
source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  gateway_hub_service = '_ros-multimaster-hub._tcp'
Used to discover hubs via zeroconf.
Properties

Inherited from threading.Thread: daemon, ident, name

Inherited from object: __class__

Method Details

__init__(self, external_discovery_update_hook, direct_hub_uri_list=[], disable_zeroconf=False)
(Constructor)

source code 

@param external_discovery_update is a callback function that takes action on a discovery @type gateway_node.update_discovery_hook(ip, port)

Parameters:
  • direct_hub_uri_list - list of uri's to hubs (e.g. http://localhost:6380 @type list of uri
Overrides: object.__init__

run(self)

source code 

The hub discovery thread worker function. Monitors zeroconf for the presence of new hubs.

We spin fast initially for convenience, and then wind down once we've detected a hub.

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

Overrides: threading.Thread.run