manager_handlers 0.7.2

A microservice manager implementation that creates HTTP-accessible handlers with configurable replicas. Handlers communicate via an internal bus, enabling collaborative request processing in a distributed architecture.
Documentation
use crate::core::communication::multibus::MultiBus;
use crate::core::{states::SharedState, traits::Base};
use crate::handler;
use async_trait::async_trait;
use std::sync::Arc;

handler! {
    RedisService1, redis_one;
    async fn run(&self, _: String, data: String) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
        println!("Received data: {}", data);

        let response = self.publish_redis("Important stuff".to_string(), "redis_two".to_string(), Some(5)).await;

        Ok(response)
    },
}

handler! {
    RedisService2, redis_two;
    async fn run(&self, _: String, data: String) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
        println!("Received data: {}", data);

        Ok("Hi from two".to_owned())
    },
}