A lightweight framework for building modular, interconnected applications.
Overwatch simplifies the development of complex systems by enabling seamless communication between independent components. It combines the flexibility of microservices with the simplicity of a unified framework.
- Requirements
- Quick Start
- Features
- Design Goals
- Components
- Project Structure
- Development Workflow
- Contributing
- License
- Community
- Rust ≥ 1.63
Add overwatch
and overwatch-derive
to your Cargo.toml
:
[dependencies]
overwatch = "1"
overwatch-derive = "1"
Here's a simple example to get you started:
// This example is for illustration purposes only and is not meant to compile.
// There's parts of the code that are required to be implemented by the user.
// Please refer to the examples directory for working code.
use overwatch::{
overwatch::OverwatchRunner,
services::{ServiceCore, ServiceData},
OpaqueServiceHandle
};
use overwatch_derive::Services;
struct MyService;
impl ServiceData for MyService {
// Implement ServiceData
}
#[async_trait::async_trait]
impl ServiceCore for MyService {
// Implement ServiceCore
}
#[derive(Services)]
struct MyApp {
my_service: OpaqueServiceHandle<MyService>,
// ... other services
}
fn main() {
// `MyAppServiceSettings` is a struct that contains the settings for each service.
// Generated by the `Services` derive.
let my_app_settings = MyAppServiceSettings {
my_service: ()
};
let my_app =
OverwatchRunner::<MyApp>::run(my_app_settings, None).expect("OverwatchRunner failed");
my_app.wait_finished();
}
- Modular Design: Build self-contained, reusable components with clear interfaces.
- Asynchronous Communication: Scalable and non-blocking communication between components.
- Lifecycle Management: Centralized control over component initialization, updates, and shutdown.
- Dynamic Configuration: Handle runtime configuration updates seamlessly.
- Testability: Components are designed for easy testing and mocking.
Our architecture is built on three core principles:
- Components are self-contained with well-defined interfaces.
- Communication between components is explicit and predictable.
- Designed for easy testing and performance evaluation.
- Each component focuses on a single task for easier debugging.
- Shared state is minimized to reduce complexity.
- Workflows are transparent and traceable.
- Components are designed for easy testing and monitoring.
- Asynchronous communication ensures scalability and clarity.
- Acts as the central messaging relay for internal communications.
- Manages the lifecycle of all services.
- Handles dynamic configuration updates.
- Modular units that perform specific tasks within the system.
- Operated and coordinated by Overwatch.
overwatch
: The core framework.overwatch-derive
: Macros to simplify component implementation.
- Run all tests:
cargo test
. - View test outputs:
cargo test -- --nocapture
.
- Execute an example:
cargo run --example {example_name}
.
- Build and open documentation:
cargo doc --open --no-deps
.
We welcome contributions! Please read our Contributing Guidelines for details on how to get started.
Overwatch is licensed under the MIT License.
Join the conversation and get help: