コード例 #1
0
def handle_blocks(websocket):
    """Receive a connection and send it database notifications.
    """
    queue = eventlet.Queue()
    eventlet.spawn(pg_listen, queue, 'blocks')
    while 1:
        item = queue.get()
        websocket.send(item.payload)
コード例 #2
0
def handle_transactions(websocket):
    """Receive a connection and send it raw transactions.

    :param websocket:
    :return:


    We create queue and pass it to the pg_listen function.  Then we wait for
    data on the queue and send it through the websocket.
    """
    queue = eventlet.Queue()
    eventlet.spawn(pg_listen, queue, 'transactions')
    while 1:
        item = queue.get()
        websocket.send(item.payload)
コード例 #3
0
def handle_fees_avg(websocket):
    queue = eventlet.Queue()
    eventlet.spawn(pg_listen, queue, 'fees_avg')
    while 1:
        item = queue.get()
        websocket.send(item.payload)