Skip to content

[FEATURE] Support for "onAny" catch-all listener. #58

@renny0gi

Description

@renny0gi

Description

Hi, guys! Thanks for you initiative, appreciate it.
I'm just wondering there are any plans to support onAny callback on the server side? NodeJs Server API's already supported this feature -> catch-all listener.

Use Case

As far as I understand the current implementation greatly depends on eventName. But one might consider the case when socketIO endpoint doens't really know how to handle(and deserialize) the particular event, but sends it further down to the target backends which will undestand and parse the particular event.

Proposed Solution

there is already EventInterceptor API, but it won't be triggered unless the corresponding event-listener exist, because of that - https://github.com/socketio4j/netty-socketio/blob/main/netty-socketio-core/src/main/java/com/socketio4j/socketio/namespace/Namespace.java#L161
is it possible to let an interceptor run without any registered event-listener?

Alternatives Considered

As a workaround one can consider defining kind of meta-event, which in turns will contain other type field in the event data. based on that type one can differentiate what's actually happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions