def __init__(self, endpoint, api_path, event_handler, principal=None, secret=None):
self.endpoint = endpoint
self.api_path = api_path
self.subscription_client = AsyncHTTPClient()
self.outbound_client = AsyncHTTPClient()
self.event_handler = event_handler
self.pending = {}
self.buffer = deque()
self.mesos_stream_id = None
self.closing = False
self.connection_successful = False
self._headers = HTTPHeaders()
if principal is not None and secret is not None:
self.headers['Authorization'] = self._basic_credential = 'Basic %s' % (
b2a_base64(
('%s:%s' % (principal, secret)).encode('ascii')
).decode('ascii').strip()
)
评论列表
文章目录