- Implemented PanicTracker to log panics using tracing within a dedicated span. - Introduced PanicInfo struct to capture panic details. - Added tests for panic catching and hook restoration. feat: implement token-bucket rate limiter - Created RateLimiter to manage token consumption with configurable rates and burst capacity. - Added methods for acquiring tokens and checking available tokens. - Included tests for rate limiting behavior and token availability. feat: add automatic retry with exponential backoff - Developed retry function to handle transient errors with configurable retry strategies. - Introduced RetryConfig for customizing retry behavior and jitter. - Added tests for various retry scenarios and error handling. feat: implement graceful shutdown coordination - Created ShutdownManager to manage shutdown signals and task completion. - Introduced ShutdownSignal for tasks to observe shutdown requests. - Added tests for shutdown request handling and task draining. feat: add timeout functionality for async operations - Implemented with_timeout function to enforce execution time limits on futures. - Created Timeout struct for wrapping futures with a deadline. - Added tests for timeout behavior and error mapping.
44 lines
1.5 KiB
TOML
44 lines
1.5 KiB
TOML
[package]
|
|
name = "corex-event"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.75"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/asepharyana/mytheclipse"
|
|
homepage = "https://github.com/asepharyana/mytheclipse"
|
|
documentation = "https://docs.rs/corex-event"
|
|
authors = ["asepharyana <superaseph@gmail.com>"]
|
|
description = "Unified events & message bus abstraction: in-memory pub/sub dispatcher plus pluggable distributed broker backends (RabbitMQ, NATS)."
|
|
readme = "README.md"
|
|
keywords = ["events", "pubsub", "message-bus", "rabbitmq", "nats"]
|
|
categories = ["asynchronous", "network-programming"]
|
|
|
|
[features]
|
|
default = ["mem"]
|
|
# In-memory dispatcher (tokio broadcast channel), always cheap.
|
|
mem = ["dep:tokio"]
|
|
# Distributed broker backends.
|
|
amqp = ["dep:lapin", "dep:futures-lite"]
|
|
nats = ["dep:async-nats", "dep:futures-util", "dep:bytes"]
|
|
|
|
[dependencies]
|
|
tracing = "0.1"
|
|
# Required unconditionally: the core `EventBus`/`Subscription` traits (always
|
|
# compiled) use it.
|
|
async-trait = "0.1"
|
|
tokio = { version = "1.53", features = ["sync", "rt"], optional = true }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# RabbitMQ (pure Rust AMQP 0.9.1 client).
|
|
lapin = { version = "2", optional = true }
|
|
futures-lite = { version = "2", optional = true }
|
|
|
|
# NATS (pure Rust client).
|
|
async-nats = { version = "0.38", optional = true }
|
|
futures-util = { version = "0.3", optional = true }
|
|
bytes = { version = "1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1.53", features = ["full"] }
|