()
Example of how to send server generated events to clients.
Example of how to send server generated events to clients.
Example of how to send server generated events to clients .
async def background_task():
    """Example of how to send server generated events to clients."""
    count = 0
    while True:
        await sio.sleep(10)
        count += 1
        await sio.emit('my_response', {'data': 'Server generated event'})
async def background_task ( ) : count = 0 while True : await sio . sleep ( 10 ) count += 1 await sio . emit ( 'my_response' , { 'data' : 'Server generated event' } )