ockam_api 0.48.0

Ockam's request-response API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use ockam::{Context, Result, Routed, Worker};

pub struct Uppercase;

#[ockam::worker]
impl Worker for Uppercase {
    type Message = String;
    type Context = Context;

    async fn handle_message(&mut self, ctx: &mut Context, msg: Routed<String>) -> Result<()> {
        ctx.send(msg.return_route(), msg.body().to_uppercase())
            .await
    }
}