pub async fn start_worker() -> Result<(), Box<dyn Error>>
Available on crate feature
cli
only.Expand description
Start a consumer worker with automatic configuration
This function loads configuration from:
- Configuration files (task-queue.toml, task-queue.yaml, etc.)
- Environment variables
- Command line arguments
- Sensible defaults
ยงExample
// Import your tasks first (this example shows the pattern)
// use my_task_app::*;
use rust_task_queue::cli::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
start_worker().await
}