Skip to content

Handling any message type #24

@ilpropheta

Description

@ilpropheta

Hi,
I have a very simple question: is it possible to make a subscription handler that will be called regardless of the message type?

Something like this:

so_subscribe(board_).event([](any_message_t m){
   // do something
});

// ...
send<int>(board_, 5); // handler called
send<MyType>(board_, MyType{}); // handler called
// ...

What's the recommended practice here?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions