python-socketio: emitting from an external process, not able to receive it on client
I am trying to emit events from external process using redis but not able to receive it on client end. I used the sample file from examples for aiohttp for client.
Code:
async def background_task():
count = 0
global streaming_status
streaming_status = True
while streaming_status:
await sio.sleep(10)
count += 1
print("Keep alive message")
await external_sio.emit('event response', {'data': 'getting external event'}, namespace=namspace_live_meeting)
await sio.emit('event response', {'data': 'Keep alive event'}, namespace=namspace_live_meeting)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (7 by maintainers)
@devamin this is the section of the docs that covers scaling the server: https://python-socketio.readthedocs.io/en/latest/server.html#scalability-notes. I have a complete example based on the Flask-SocketIO extension here: https://github.com/miguelgrinberg/flack.
The code that you posted is actually incorrect. Emitting from an auxiliary process is a feature that allows the aux process to emit to a client. You seem to be trying to emit to the server, which is not what this feature does. If you want to emit to the server, then there is no reason to use an auxiliary process, just use the client directly.