docs.rs failed to build taskvisor-0.0.8
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
taskvisor-0.0.12
taskvisor
Event-driven task orchestration library for Rust.
📖 Features
- Observe lifecycle events (start / stop / failure / backoff / timeout / shutdown)
- Plug custom subscribers for logging, metrics, alerting
- Global concurrency limiting and graceful shutdown on OS signals
- Supervised task actors with restart/backoff/timeout policies
📦 Installation
Cargo.toml:
[]
= "0.0.7"
Optional features:
loggingenables the built-in [LogWriter], (demo logger);controllerenables the slot-based [Controller] with admission policies.
[]
= { = "0.0.8", = ["logging"] }
📝 Quick start
Minimal Example (No subscribers)
[]
= "0.0.8"
= { = "1", = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
= { = "0.7", = ["rt"] }
= "1"
//! Minimal: single task, no subscribers.
use Duration;
use CancellationToken;
use *;
async
Minimal Example (Embedded subscriber)
[]
= { = "0.0.8", = ["logging"] }
= { = "1", = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
= { = "0.7", = ["rt"] }
= "1"
//! Minimal with built-in LogWriter subscriber.
use Duration;
use CancellationToken;
use ;
async
Dynamic Tasks Example
[]
= "0.0.8"
= { = "1", = ["macros", "rt-multi-thread", "time", "sync", "signal"] }
= { = "0.7", = ["rt"] }
= "1"
//! Demonstrates how a running task can add another task dynamically.
use Arc;
use Duration;
use CancellationToken;
use ;
async
Controller Feature
When the controller feature is enabled, Taskvisor gains a dedicated Controller layer that manages task admission and scheduling before tasks are handed to the Supervisor.
# Cargo.toml
[]
= { = "0.0.8", = ["controller"] }
submit(ControllerSpec)
▼
┌──────────────┐
│ Controller │ ← Admission control (Drop / Replace / Queue)
└──────┬───────┘
▼
┌──────────────┐
│ Supervisor │
│ spawns task │
└──────┬───────┘
▼
Task Actors
use ;
use CancellationToken;
use ;
async
Admission modes:
DropIfRunningdiscard if a task with the same name is still active.Replacecancel and replace the running task.Queueenqueue until the slot becomes free. The controller uses an internal async queue (mpsc) to serialize submissions and integrates with the global concurrency limit of Supervisor.
More Examples
Check out the examples directory for:
- basic_one_shot.rs: single one-shot task, graceful shutdown
- retry_with_backoff.rs: retry loop with exponential backoff and jitter
- dynamic_add_remove.rs: add/remove tasks at runtime via API
- custom_subscriber.rs: custom subscriber reacting to events
- task_cancel.rs: task cancellation from outside
- controller.rs: examples with
controllerfeature
# basic / retry / dynamic do not require extra features
🤝 Contributing
We're open to any new ideas and contributions.
Found a bug? Have an idea? We welcome pull requests and issues.