use crate::Context;
use ockam_core::compat::boxed::Box;
use ockam_core::compat::string::String;
use ockam_core::{Result, Routed, Worker};
pub struct Echoer;
#[ockam_core::worker]
impl Worker for Echoer {
type Context = Context;
type Message = String;
async fn handle_message(&mut self, ctx: &mut Context, msg: Routed<String>) -> Result<()> {
debug!("Address: {}, Received: {:?}", ctx.primary_address(), msg);
ctx.send(msg.return_route().clone(), msg.into_body()?).await
}
}