Thread. More...
Public Member Functions | |
def | __init__ |
def | disengage_hub |
def | run |
def | shutdown |
Public Attributes | |
discovery_update_hook | |
trigger_update | |
Static Public Attributes | |
string | gateway_hub_service = "_ros-multimaster-hub._tcp" |
Private Member Functions | |
def | _direct_scan |
Private methods. | |
def | _sleep |
def | _zeroconf_scan |
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 | |
_trigger_update | |
_zeroconf_discovered_hubs | |
_zeroconf_services_available |
Thread.
Definition at line 23 of file hub_discovery.py.
def rocon_hub_client.hub_discovery.HubDiscovery.__init__ | ( | self, | |
external_discovery_update_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.
Definition at line 163 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 149 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 186 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 130 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. 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.
Definition at line 68 of file hub_discovery.py.
Called from the main program to shutdown this thread.
Definition at line 59 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 76 of file hub_discovery.py.
Definition at line 76 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 76 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 61 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 of file hub_discovery.py.
Definition at line 38 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.
Definition at line 38 of file hub_discovery.py.