diff --git a/Cargo.lock b/Cargo.lock index da40534..76f31fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -467,9 +467,11 @@ dependencies = [ name = "baobab_actor" version = "0.1.0" dependencies = [ + "anyhow", "async-trait", "chrono", "clap", + "crossterm", "env_logger", "hero_job", "hero_supervisor", @@ -477,6 +479,7 @@ dependencies = [ "heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)", "heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)", "log", + "ratatui", "redis 0.25.4", "rhai", "serde", diff --git a/core/actor/src/actor_trait.rs b/core/actor/src/actor_trait.rs index baeb61b..3cc7b44 100644 --- a/core/actor/src/actor_trait.rs +++ b/core/actor/src/actor_trait.rs @@ -1,32 +1,3 @@ -//! # Actor Trait Abstraction -//! -//! This module provides a trait-based abstraction for Rhai actors that eliminates -//! code duplication between synchronous and asynchronous actor implementations. -//! -//! The `Actor` trait defines the common interface and behavior, while specific -//! implementations handle job processing differently (sync vs async). -//! -//! ## Architecture -//! -//! ```text -//! ┌─────────────────┐ ┌─────────────────┐ -//! │ SyncActor │ │ AsyncActor │ -//! │ │ │ │ -//! │ process_job() │ │ process_job() │ -//! │ (sequential) │ │ (concurrent) │ -//! └─────────────────┘ └─────────────────┘ -//! │ │ -//! └───────┬───────────────┘ -//! │ -//! ┌───────▼───────┐ -//! │ Actor Trait │ -//! │ │ -//! │ spawn() │ -//! │ config │ -//! │ common loop │ -//! └───────────────┘ -//! ``` - use hero_job::Job; use log::{debug, error, info}; use redis::AsyncCommands; @@ -44,7 +15,6 @@ pub struct ActorConfig { pub actor_id: String, pub db_path: String, pub redis_url: String, - pub preserve_tasks: bool, pub default_timeout: Option, // Only used by async actors } @@ -54,13 +24,11 @@ impl ActorConfig { actor_id: String, db_path: String, redis_url: String, - preserve_tasks: bool, ) -> Self { Self { actor_id, db_path, redis_url, - preserve_tasks, default_timeout: None, } }