Function start_worker

Source
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:

  1. Configuration files (task-queue.toml, task-queue.yaml, etc.)
  2. Environment variables
  3. Command line arguments
  4. 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
}