1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! tasker-orchestration: Orchestration system for workflow coordination
//! This crate contains the orchestration-specific functionality including
//! the orchestration core, coordinator, finalization system, and web API.
// Allow technical terms like PostgreSQL, SQLx in docs
// Allow public functions without # Errors sections
// Allow methods without must_use when context is clear
//! # Tasker Core Rust
//!
//! High-performance Rust implementation of the core workflow orchestration engine.
//!
//! ## Overview
//!
//! Tasker Core Rust is designed to complement the existing Ruby on Rails **Tasker** engine,
//! leveraging Rust's memory safety, fearless parallelism, and performance characteristics
//! to handle computationally intensive workflow orchestration, dependency resolution,
//! and state management operations.
//!
//! ## Architecture
//!
//! The core implements a **step handler foundation** where Rust provides the complete
//! step handler base class that frameworks (Rails, Python, Node.js) extend through
//! subclassing with `process()` and `process_results()` hooks.
//!
//! ## Key Features
//!
//! - **Complete Model Layer**: All 18+ Rails models migrated with 100% schema parity
//! - **High-Performance Queries**: Rails-equivalent scopes with compile-time verification
//! - **SQL Function Integration**: Direct PostgreSQL function integration for complex operations
//! - **Memory Safety**: Zero memory leaks with Rust's ownership model
//! - **Type Safety**: Compile-time prevention of SQL injection and type mismatches
//! - **SQLx Native Testing**: Automatic database isolation per test (114+ tests)
//!
//! ## Module Organization
//!
//! - [`actors`] - Actor-based architecture for lifecycle components (TAS-46)
//! - [`orchestration`] - Core workflow orchestration logic and components
//! - [`web`] - REST API server (optional, requires `web-api` feature)
//!
//! Additional functionality provided by tasker-shared:
//! - Models, database operations, configuration, error handling
//! - PostgreSQL message queue (pgmq) integration
//! - Circuit breaker patterns and fault tolerance
//!
//! Testing utilities are available in tasker-worker/src/testing for pure Rust testing patterns.
//!
//! ## Performance Targets
//!
//! - **10-100x faster** than Ruby/Rails equivalents
//! - **Sub-millisecond** atomic state changes
//! - **Memory-safe parallelism** with better resource utilization
//! - **Zero-cost abstractions** where possible
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use tasker_shared::config::tasker::TaskerConfig;
//!
//! // Configuration is loaded from TOML files via SystemContext
//! // See tasker-shared/src/system_context.rs for initialization patterns
//! // This example shows the V2 configuration structure:
//! # async {
//! let context = tasker_shared::system_context::SystemContext::new_for_orchestration().await.unwrap();
//! let config = &context.tasker_config;
//!
//! // Configuration provides execution settings
//! assert_eq!(config.common.execution.environment, "test");
//! # };
//!
//! // For complete database integration examples, see tests/models/ directory
//! ```
//!
//! ## Integration
//!
//! This Rust core serves as the foundational step handler that frameworks extend.
//! The Rails engine provides the web interface and developer ergonomics, while this
//! Rust core handles all performance and safety-critical workflow orchestration logic.
//!
//! ## Testing
//!
//! The project uses SQLx native testing with automatic database isolation:
//!
//! ```bash
//! cargo test --lib # Unit tests
//! cargo test # All tests (114+ tests)
//! ```
// Re-export commonly used types from tasker-shared
pub use ;
pub use ;