pub async fn start_cli_worker(
config: TaskQueueConfig,
) -> Result<(), Box<dyn Error>>
Available on crate feature
cli
only.Expand description
Start a consumer task worker with the given configuration
This function automatically discovers tasks from the consumer library and starts the specified number of worker processes.
ยงExample
// Import your tasks first (this example shows the pattern)
// use my_task_app::*;
use rust_task_queue::cli::*;
use rust_task_queue::config::TaskQueueConfig;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = TaskQueueConfig::load()?;
start_cli_worker(config).await
}