rename worker to actor
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
### `Job`
|
||||
Represents a script execution request with:
|
||||
- Unique ID and timestamps
|
||||
- Script content and target worker
|
||||
- Script content and target actor
|
||||
- Execution settings (timeout, retries, concurrency)
|
||||
- Logging configuration
|
||||
|
||||
### `JobBuilder`
|
||||
Fluent builder for configuring jobs:
|
||||
- `script()` - Set the script content
|
||||
- `worker_id()` - Target specific worker
|
||||
- `actor_id()` - Target specific actor
|
||||
- `timeout()` - Set execution timeout
|
||||
- `build()` - Create the job
|
||||
- `submit()` - Fire-and-forget submission
|
||||
|
@@ -11,22 +11,22 @@ mod builder;
|
||||
/// Redis namespace prefix for all Hero job-related keys
|
||||
pub const NAMESPACE_PREFIX: &str = "hero:job:";
|
||||
|
||||
/// Script type enumeration for different worker types
|
||||
/// Script type enumeration for different actor types
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum ScriptType {
|
||||
/// OSIS - A worker that executes Rhai/HeroScript
|
||||
/// OSIS - A actor that executes Rhai/HeroScript
|
||||
OSIS,
|
||||
/// SAL - A worker that executes system abstraction layer functionalities in rhai
|
||||
/// SAL - A actor that executes system abstraction layer functionalities in rhai
|
||||
SAL,
|
||||
/// V - A worker that executes heroscript in V
|
||||
/// V - A actor that executes heroscript in V
|
||||
V,
|
||||
/// Python - A worker that executes heroscript in python
|
||||
/// Python - A actor that executes heroscript in python
|
||||
Python,
|
||||
}
|
||||
|
||||
impl ScriptType {
|
||||
/// Get the worker queue suffix for this script type
|
||||
pub fn worker_queue_suffix(&self) -> &'static str {
|
||||
/// Get the actor queue suffix for this script type
|
||||
pub fn actor_queue_suffix(&self) -> &'static str {
|
||||
match self {
|
||||
ScriptType::OSIS => "osis",
|
||||
ScriptType::SAL => "sal",
|
||||
@@ -81,7 +81,7 @@ impl JobStatus {
|
||||
/// Representation of a script execution request.
|
||||
///
|
||||
/// This structure contains all the information needed to execute a script
|
||||
/// on a worker service, including the script content, dependencies, and metadata.
|
||||
/// on a actor service, including the script content, dependencies, and metadata.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Job {
|
||||
pub id: String,
|
||||
|
Reference in New Issue
Block a user