MCPcopy Create free account
hub / github.com/ccxt/ccxt / __init__

Method __init__

python/ccxt/async_support/base/ws/client.py:55–79  ·  view source on GitHub ↗
(self, url, on_message_callback, on_error_callback, on_close_callback, on_connected_callback, config={})

Source from the content-addressed store, hash-verified

53 decompressBinary = True # decompress binary messages by default
54
55 def __init__(self, url, on_message_callback, on_error_callback, on_close_callback, on_connected_callback, config={}):
56 defaults = {
57 'url': url,
58 'futures': {},
59 'subscriptions': {},
60 'rejections': {},
61 'on_message_callback': on_message_callback,
62 'on_error_callback': on_error_callback,
63 'on_close_callback': on_close_callback,
64 'on_connected_callback': on_connected_callback,
65 }
66 settings = {}
67 settings.update(defaults)
68 settings.update(config)
69 for key in settings:
70 if hasattr(self, key) and isinstance(getattr(self, key), dict):
71 setattr(self, key, deep_extend(getattr(self, key), settings[key]))
72 else:
73 setattr(self, key, settings[key])
74 # connection-related Future
75 if "options" in config:
76 self.options = config["options"]
77 else:
78 self.options = config
79 self.connected = Future()
80
81 def future(self, message_hash):
82 if message_hash not in self.futures or self.futures[message_hash].cancelled():

Callers

nothing calls this directly

Calls 3

FutureClass · 0.90
deep_extendFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected