本文整理汇总了Python中events.Events方法的典型用法代码示例。如果您正苦于以下问题:Python events.Events方法的具体用法?Python events.Events怎么用?Python events.Events使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类events
的用法示例。
在下文中一共展示了events.Events方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import events [as 别名]
# 或者: from events import Events [as 别名]
def __init__(self):
self.events = Events()
示例2: __init__
# 需要导入模块: import events [as 别名]
# 或者: from events import Events [as 别名]
def __init__(self, url=None, retry_timeout=None, max_retries=None):
super(OrderBook, self).__init__(url, retry_timeout, max_retries)
self._on_ping = Events()
self._on_ping.on_change += self.on_ping
self.order_nounces = {}
self.order_books = {}
示例3: _assign_callbacks
# 需要导入模块: import events [as 别名]
# 或者: from events import Events [as 别名]
def _assign_callbacks(self):
self._on_public_callback = Events()
self._on_public_callback.on_change += self.on_public
self._on_private_callback = Events()
self._on_private_callback.on_change += self.on_private
示例4: __init__
# 需要导入模块: import events [as 别名]
# 或者: from events import Events [as 别名]
def __init__(
self,
accounts=None,
markets=None,
objects=None,
on_tx=None,
on_object=None,
on_block=None,
on_account=None,
on_market=None,
keep_alive=25,
**kwargs
):
# Events
super(Notify, self).__init__()
self.events = Events()
# BitShares instance
BlockchainInstance.__init__(self, **kwargs)
# Callbacks
if on_tx:
self.on_tx += on_tx
if on_object:
self.on_object += on_object
if on_block:
self.on_block += on_block
if on_account:
self.on_account += on_account
if on_market:
self.on_market += on_market
# Open the websocket
self.websocket = BitSharesWebsocket(
urls=self.blockchain.rpc.urls,
user=self.blockchain.rpc.user,
password=self.blockchain.rpc.password,
accounts=accounts,
markets=self.get_market_ids(markets),
objects=objects,
on_tx=on_tx,
on_object=on_object,
on_block=on_block,
on_account=self.process_account,
on_market=self.process_market,
keep_alive=keep_alive,
)