Python events.Events() Examples

The following are 5 code examples of events.Events(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module events , or try the search function .
Example #1
Source File: mixins.py    From haven with MIT License 5 votes vote down vote up
def __init__(self):
        self.events = Events() 
Example #2
Source File: mixins.py    From haven with MIT License 5 votes vote down vote up
def __init__(self):
        self.events = Events() 
Example #3
Source File: order_book.py    From python-bittrex-websocket with MIT License 5 votes vote down vote up
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 = {} 
Example #4
Source File: websocket_client.py    From python-bittrex-websocket with MIT License 5 votes vote down vote up
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 
Example #5
Source File: notify.py    From python-bitshares with MIT License 4 votes vote down vote up
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,
        )