remove preserve tasks from actor trait
This commit is contained in:
@@ -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<Duration>, // 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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user