jamesmunns / postcard-rpc

An RPC layer for postcard based protocols
Apache License 2.0
48 stars 11 forks source link

Embassy Target Server Impl #9

Closed jamesmunns closed 2 months ago

jamesmunns commented 2 months ago

Currently looks like this:

define_dispatch! {
    dispatcher: Dispatcher<Mutex = FakeMutex, Driver = FakeDriver>;
    AlphaEndpoint => async alpha_handler,
    BetaEndpoint => async beta_handler,
    GammaEndpoint => async gamma_handler,
    DeltaEndpoint => blocking delta_handler,
    EpsilonEndpoint => spawn epsilon_handler_task,
}

async fn alpha_handler(_header: WireHeader, _body: AReq) -> AResp {
    todo!()
}

async fn beta_handler(_header: WireHeader, _body: BReq) -> BResp {
    todo!()
}

async fn gamma_handler(_header: WireHeader, _body: GReq) -> GResp {
    todo!()
}

fn delta_handler(_header: WireHeader, _body: DReq) -> DResp {
    todo!()
}

#[embassy_executor::task]
async fn epsilon_handler_task(_header: WireHeader, _body: EReq, _sender: Sender<FakeMutex, FakeDriver>) {
    todo!()
}