X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/71a9cb71e4cabe1444f68222c0bd7ad4324d6a5e..0d32948a1c78385f9305799c5cb47127492c4320:/sdk/python/arvados/events.py diff --git a/sdk/python/arvados/events.py b/sdk/python/arvados/events.py index 7e8cdc3282..94dd62b4ed 100644 --- a/sdk/python/arvados/events.py +++ b/sdk/python/arvados/events.py @@ -22,6 +22,11 @@ class EventClient(WebSocketClient): ssl_options['cert_reqs'] = ssl.CERT_NONE else: ssl_options['cert_reqs'] = ssl.CERT_REQUIRED + + # Warning: If the host part of url resolves to both IPv6 and + # IPv4 addresses (common with "localhost"), only one of them + # will be attempted -- and it might not be the right one. See + # ws4py's WebSocketBaseClient.__init__. super(EventClient, self).__init__(url, ssl_options=ssl_options) self.filters = filters self.on_event = on_event @@ -107,9 +112,9 @@ class PollClient(threading.Thread): def subscribe(api, filters, on_event, poll_fallback=15): ''' - api: Must be a newly created from arvados.api(cache=False), not shared with the caller, as it may be used by a background thread. + api: a client object retrieved from arvados.api(). The caller should not use this client object for anything else after calling subscribe(). filters: Initial subscription filters. - on_event: The callback when a message is received + on_event: The callback when a message is received. poll_fallback: If websockets are not available, fall back to polling every N seconds. If poll_fallback=False, this will return None if websockets are not available. ''' ws = None