本文整理匯總了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,
)