use kaffix::prelude::*; use serde::{Deserialize, Serialize}; use tokio; #[derive(Serialize, Deserialize)] struct SomeService { pub number: u32, } impl Service for SomeService { type Message = SomeService; fn on_message(message: Self::Message, _ctx: &Context) { println!( "HELLO! I'm some service! The number I got is {}", message.number ); } fn info() -> ServiceInfo { ServiceInfo { name: "some-service", version_major: 1, version_minor: 0, } } } #[tokio::main] async fn main() { App::new().add_service::().run().await; }