taskflow_rs/lib.rs
1//! taskflow-rs: A high-performance, async-first task orchestration framework for Rust
2//!
3//! # Overview
4//!
5//! taskflow-rs provides a robust framework for scheduling, executing, and managing
6//! asynchronous tasks with dependency resolution, automatic retries, and pluggable
7//! storage backends.
8//!
9//! # Key Features
10//! - 🚀 **Async-first architecture** built on Tokio for maximum performance
11//! - 🔄 **Automatic retry** with configurable backoff strategies
12//! - 📋 **Task dependencies** for complex workflow orchestration
13//! - 🧩 **Pluggable storage** supporting multiple backend implementations
14//! - 📊 **Real-time monitoring** of task execution and system metrics
15//! - 🛡️ **Memory safety** guaranteed by Rust's ownership model
16//!
17//! # Quick Start
18//! ```rust,no_run
19//! use taskflow_rs::TaskFlow;
20//! use taskflow_rs::task::TaskDefinition;
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<(), taskflow_rs::TaskFlowError> {
24//! // Create a new TaskFlow instance
25//! let taskflow = TaskFlow::new_default().await?;
26//!
27//! // Submit a task for execution
28//! let task_id = taskflow.submit_task(
29//! TaskDefinition::new("example", "python_handler")
30//! .with_payload("script", "print('Hello from TaskFlow!')")
31//! ).await?;
32//!
33//! // Wait for task completion and get result
34//! let result = taskflow.wait_for_task(task_id).await?;
35//! println!("Task result: {:?}", result);
36//!
37//! Ok(())
38//! }
39//! ```
40//!
41//! # Architecture
42//!
43//! The framework consists of several core components:
44//! - **TaskFlow**: Main entry point and coordination layer
45//! - **Scheduler**: Responsible for task scheduling and dependency resolution
46//! - **Executor**: Handles task execution with multiple handler types
47//! - **Storage**: Abstract interface for task persistence
48//! - **Task**: Core data structures for task definitions and results
49//!
50//! # Supported Task Handlers
51//! - Python script execution
52//! - File operations (create, read, write, delete)
53//! - HTTP requests
54//! - Shell command execution
55//! - Custom handlers (extensible via trait implementation)
56
57pub mod error;
58pub mod executor;
59pub mod framework;
60pub mod scheduler;
61pub mod storage;
62pub mod task;
63
64/// Common error type for all TaskFlow operations
65pub use error::TaskFlowError;
66
67/// Executor component for handling task execution
68pub use executor::Executor;
69
70/// Main TaskFlow framework entry point
71pub use framework::TaskFlow;
72
73/// Scheduler component for task coordination
74pub use scheduler::Scheduler;
75
76/// Task-related data structures and definitions
77pub use task::{Task, TaskDefinition, TaskResult, TaskStatus};