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)
def test_message(): emit('price_responce', get_info())
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())