Expand description
§gearman-worker
The gearman-worker crate provides a high level library to easily
implement gearman Workers.
It handles registration of functions as jobs in the gearman queue server, fetching of jobs and their workload.
§Usage
ⓘ
use gearman_worker::WorkerBuilder;
fn main() {
let mut worker = WorkerBuilder::default().build();
worker.connect().unwrap();
worker.register_function("greet", |input| {
let hello = String::from_utf8_lossy(input);
let response = format!("{} world!", hello);
Ok(response.into_bytes())
}).unwrap();
worker.run().unwrap();
}Structs§
- Worker
- The
Workerprocesses jobs provided by the gearman queue server. - Worker
Builder - Helps building a new
Worker