Client wildcard event callback does not fire on receipt of event #820
-
async def main():
sio = socketio.AsyncClient(logger=True, engineio_logger=True)
@sio.on('*')
async def on_message(*args, **kwargs):
print('XXXXXXXX I received a message! (not namespaced)', args, kwargs)
@sio.on('*', namespace='/xxx')
async def on_message2(*args, **kwargs):
print('XXXXXXXX I received a message! (namespaced)', args, kwargs)
await sio.connect(url, namespaces=['/xxx'])
await sio.wait() The debug log shows that a message is coming in, but neither of the callbacks appear to fire, or else the print statement does not make it to stdout.
It does work to explicitly provide the event name: @sio.on('Heartbeat', namespace='/xxx')
def whatever(*args, **kwargs):
print('XXXXXXXX I received a message!', args, kwargs) or @sio.event(namespace='/xxx')
def Heartbeat(*args, **kwargs):
print('XXXXXXXX I received a message!', args, kwargs) However the wildcard does not appear to work with or without the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@rgov The catch-all feature was released just a couple of weeks ago. Are you sure you have the latest release 5.4.1? That's the only release so far that has this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarifying @miguelgrinberg. It might be really helpful if the Read the Docs documentation were versioned. Not sure how easy that is to do, but that could cut down on the number of questions like this. |
Beta Was this translation helpful? Give feedback.
@rgov The catch-all feature was released just a couple of weeks ago. Are you sure you have the latest release 5.4.1? That's the only release so far that has this.