[][src]Function linux_aio_tokio::generic_aio_context

pub fn generic_aio_context<M, A, L>(
    nr: usize,
    use_semaphore: bool
) -> Result<(GenericAioContext<M, A, L>, GenericAioContextHandle<M, A, L>, impl Future<Output = Result<(), Error>>), AioContextError> where
    A: IntrusiveAdapter<M, L>,
    A::LinkOps: LinkedListOps + Default,
    L: DefaultLinkOps<Ops = A::LinkOps> + Default,
    M: RawMutex

Create new AIO context with nr number of threads

If use_semaphore is set to true, the request sending future will wait until the kernel thread is freed. Otherwise, no wait for available capacity occurs. It's the user's code responsibility to ensure that number of in-flight queries doesn't exceed the number of kernel threads.