Expand description
§acton-service
Production-ready Rust backend framework with multi-protocol support (HTTP + gRPC + WebSocket). Works equally well for monolithic applications and microservices architectures.
§Features
- Multi-protocol: HTTP (axum) + gRPC (tonic) + WebSocket on single port
- Middleware stack: PASETO v4 or JWT token auth, rate limiting, request tracking, panic recovery, body size limits
- Authorization: Cedar policy engine across HTTP, gRPC, and GraphQL
- Resilience: Circuit breaker, retry with backoff, bulkhead (concurrency limiting)
- Observability: OpenTelemetry tracing, HTTP metrics, request ID propagation
- Audit logging: BLAKE3 hash-chained trails over PostgreSQL, Turso, SurrealDB, or ClickHouse
- TLS: rustls listener with mutual TLS, SAN-allowlist caller authorization, and restart-free credential rotation
- Connection pooling: PostgreSQL, Redis, NATS JetStream
- Health checks: Liveness and readiness probes
- Graceful shutdown: Proper signal handling (SIGTERM, SIGINT)
§Example
use acton_service::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
// Load configuration
let config = Config::load()?;
// Initialize tracing
init_tracing(&config)?;
// Build application state
let state = AppState::builder()
.config(config.clone())
.build()
.await?;
// Create router
let app = Router::new()
.route("/health", get(health))
.route("/ready", get(readiness))
.with_state(state);
// Run server
Server::new(config)
.serve(app)
.await?;
Ok(())
}Modules§
- agents
- Internal agent-based components
- build_
utils - Build-time utilities for compiling protocol buffers
- checks
- App-defined liveness and readiness checks.
- config
- Configuration management using Figment
- crypto
- Rustls crypto provider bootstrap.
- error
- Error types and HTTP response conversion
- extensions
- Actor-backed extensions for custom application state
- health
- Health check handlers
- ids
- Type-safe identifiers using the TypeID specification
- metrics_
exporter - A dedicated, plaintext listener that serves only
GET /metrics. - middleware
- Middleware modules for authentication, rate limiting, and more
- observability
- OpenTelemetry tracing and observability
- pool_
health - Connection pool health monitoring
- prelude
- Prelude module for convenient imports
- responses
- HTTP response builders with correct status codes
- server
- HTTP server with graceful shutdown
- service_
builder - Type-safe service builder that enforces API versioning and best practices
- state
- Application state management
- versioning
- API versioning utilities for managing API evolution