jamesmunns / postcard-rpc

An RPC layer for postcard based protocols
Apache License 2.0
93 stars 22 forks source link

target_server: How to write `Topic` handlers? #15

Closed jamesmunns closed 3 weeks ago

jamesmunns commented 6 months ago

Right now, there's no define_dispatch! syntax for handling incoming Topic messages.

We implicitly support Topics MCU -> PC using the Sender methods.

We should probably have some syntax for "topic" handlers, like:

define_dispatch! {
    ...
    SomeTopic => topic blocking some_handler,
}

or make "sections" for endpoints and topics, e.g.:

define_dispatch! {
    ...
    endpoints: {
        SomeEndpoint => async some_endpoint_handler,
    }
    // maybe `incoming_topics`?
    topics: {
        SomeTopic => async some_topic_handler,
    }
}
jamesmunns commented 3 weeks ago

This was closed by #53