Example #1
0
def test_connect():
    emit('price_responce', get_info())
    global thread
    with thread_lock:
        if thread is None:
            thread = socketio.start_background_task(target=background_thread)
Example #2
0
def test_message():
    emit('price_responce', get_info())
Example #3
0
def background_thread():
    """Example of how to send server generated events to clients."""
    while True:
        socketio.sleep(5)
        socketio.emit('price_responce', get_info())
def background_thread():
    while True:
        socketio.sleep(5)
        socketio.emit('price_responce', get_info())