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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//! Copyright © 2025-2026 Wenze Wei. All Rights Reserved.
//!
//! This file is part of Ri.
//! The Ri project belongs to the Dunimd Team.
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! You may not use this file except in compliance with the License.
//! You may obtain a copy of the License at
//!
//! http://www.apache.org/licenses/LICENSE-2.0
//!
//! Unless required by applicable law or agreed to in writing, software
//! distributed under the License is distributed on an "AS IS" BASIS,
//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//! See the License for the specific language governing permissions and
//! limitations under the License.
//! # Core Runtime Module
//!
//! The core module provides the fundamental building blocks for Ri applications,
//! including the application builder, service context, error handling, and module lifecycle management.
//!
//! ## Key Components
//!
//! - **error**: Error handling with custom error types and result aliases
//! - **context**: Service context for accessing core functionalities
//! - **module**: Module system for extending Ri with custom functionality
//! - **runtime**: Application runtime and builder for constructing Ri applications
//! - **lifecycle**: Lifecycle management for modules
//! - **analytics**: Basic analytics and telemetry support
//!
//! ## Design Principles
//!
//! The core module follows the following design principles:
//!
//! 1. **Dependency Injection**: Components are accessed through the service context,
//! allowing for easy mocking and testing
//! 2. **Builder Pattern**: The `RiAppBuilder` provides a fluent API for configuring applications
//! 3. **Module System**: A flexible module system allows for easy extension
//! 4. **Error Handling**: A unified error type simplifies error management across modules
//! 5. **Async First**: Full support for asynchronous operations
//!
//! ## Usage Example
//!
//! ```rust
//! use ri::prelude::*;
//!
//! #[tokio::main]
//! async fn main() -> RiResult<()> {
//! let app = RiAppBuilder::new()
//! .with_config("config.yaml")?
//! .with_module(Box::new(MyModule::new()))
//! .build()?;
//!
//! app.run(|ctx| async move {
//! ctx.logger().info("service", "Ri service started")?;
//! Ok(())
//! }).await
//! }
//! ```
/// Error handling with custom error types and result aliases
/// Safe lock utilities for concurrent programming
/// Service context for accessing core functionalities
/// Module system for extending Ri with custom functionality
/// Application runtime and builder for constructing Ri applications
/// Application builder for constructing Ri applications
/// Application runtime for managing Ri application lifecycle
/// Module types for distinguishing between sync and async modules
/// Module sorter for sorting modules based on dependencies and priority
/// Lifecycle management for modules
/// Basic analytics and telemetry support
/// Health checks for modules and services
/// Error chain utilities
/// Sharded lock implementation for improved concurrent performance
/// Main error type for Ri operations
pub use ;
/// Service context providing access to core functionalities
pub use RiServiceContext;
/// Module traits for extending Ri functionality
pub use RiModule;
/// Application builder and runtime for constructing Ri applications
pub use ;
/// Internal module traits
pub use ;
/// Lock utilities
pub use ;
/// Python module bindings
pub use ;
/// Error chain utilities
pub use ;
/// Health check types
pub use ;
/// Lifecycle management
pub use RiLifecycleObserver;
/// Analytics module
pub use RiLogAnalyticsModule;
/// Sharded lock types
pub use RiShardedLockStats;