Struct batch::Worker
[−]
[src]
pub struct Worker<Ctx> { /* fields omitted */ }
Long-running worker polling tasks from the given Broker
.
Methods
impl<Ctx> Worker<Ctx>
[src]
fn run(self) -> Box<Future<Item = (), Error = Error>>
[src]
Runs the worker, polling tasks from the broker and executing them.
Example
extern crate batch; extern crate tokio_core; use batch::WorkerBuilder; use tokio_core::reactor::Core; fn main() { let mut core = Core::new().unwrap(); let handle = core.handle(); let worker = WorkerBuilder::new(()) .handle(handle) .build() .unwrap(); let task = worker.run(); core.run(task).unwrap(); }
Trait Implementations
impl<Ctx> Debug for Worker<Ctx> where
Ctx: Debug,
[src]
Ctx: Debug,