pub async fn start_worker_with_builder<F>(
builder_fn: F,
) -> Result<(), Box<dyn Error>>
Available on crate feature
cli
only.Expand description
Start a consumer worker with custom configuration built using the builder pattern
ยงExample
// Import your tasks first (this example shows the pattern)
// use my_task_app::*;
use rust_task_queue::cli::*;
use rust_task_queue::config::ConfigBuilder;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ConfigBuilder::new()
.redis_url("redis://localhost:6379")
.workers(4)
.enable_auto_register(true)
.enable_scheduler(true)
.build();
start_cli_worker(config).await
}