MCPcopy Create free account
hub / github.com/apache/qpid-proton / __init__

Method __init__

python/proton/_utils.py:368–399  ·  view source on GitHub ↗
(
            self,
            url: Optional[Union[str, Url]] = None,
            timeout: Optional[float] = None,
            container: Optional[Container] = None,
            ssl_domain: Optional['SSLDomain'] = None,
            heartbeat: Optional[float] = None,
            urls: Optional[List[str]] = None,
            reconnect: Union[None, Literal[False], 'Backoff'] = None,
            **kwargs
    )

Source from the content-addressed store, hash-verified

366 """
367
368 def __init__(
369 self,
370 url: Optional[Union[str, Url]] = None,
371 timeout: Optional[float] = None,
372 container: Optional[Container] = None,
373 ssl_domain: Optional['SSLDomain'] = None,
374 heartbeat: Optional[float] = None,
375 urls: Optional[List[str]] = None,
376 reconnect: Union[None, Literal[False], 'Backoff'] = None,
377 **kwargs
378 ) -> None:
379 self.disconnected = False
380 self.timeout = timeout or 60
381 self.container = container or Container()
382 self.container.timeout = self.timeout
383 self.container.start()
384 self.conn = None
385 self.closing = False
386 # Preserve previous behaviour if neither reconnect nor urls are supplied
387 if url is not None and urls is None and reconnect is None:
388 reconnect = False
389 url = Url(url).defaults()
390 failed = True
391 try:
392 self.conn = self.container.connect(url=url, handler=self, ssl_domain=ssl_domain, reconnect=reconnect,
393 heartbeat=heartbeat, urls=urls, **kwargs)
394 self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_UNINIT),
395 msg="Opening connection")
396 failed = False
397 finally:
398 if failed and self.conn:
399 self.close()
400
401 def create_sender(
402 self,

Callers

nothing calls this directly

Calls 7

waitMethod · 0.95
closeMethod · 0.95
UrlClass · 0.85
ContainerClass · 0.70
startMethod · 0.45
defaultsMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected