Expand description
A tasque extension specialized for fibers.
This provides an extension trait and the default task queues.
§Examples
use fibers::{Executor, InPlaceExecutor};
use fibers_tasque::{AsyncCallError, DefaultCpuTaskQueue, DefaultIoTaskQueue, TaskQueueExt};
let mut executor = InPlaceExecutor::new().unwrap();
let future = DefaultCpuTaskQueue.async_call(|| 1 + 1);
assert_eq!(executor.run_future(future).unwrap(), Ok(2));
let future = DefaultIoTaskQueue.async_call(|| -> () { panic!() });
assert_eq!(executor.run_future(future).unwrap(), Err(AsyncCallError));Structs§
- Async
Call - A
Futurethat represents an asynchronous function call. - Async
Call Error - An
Errorused if the worker thread that executing a asynchronous function aborted. - Default
CpuTask Queue - The default queue for executing CPU intensive tasks.
- Default
IoTask Queue - The default queue for executing I/O intensive tasks.
Traits§
- Task
Queue Ext TaskQueueextension.