Function start_worker_from_env

Source
pub async fn start_worker_from_env() -> Result<(), Box<dyn Error>>
Available on crate feature cli only.
Expand description

Start a consumer worker with configuration from environment variables only

This is useful when you want to avoid file-based configuration and only use environment variables.

ยง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_from_env().await
}