Struct batch_loader::Loader
[−]
[src]
pub struct Loader<B> where
B: Backend, { /* fields omitted */ }
Batched data loader interface
Loader is composed of the queue which associated to the backend.
Methods
impl<B> Loader<B> where
B: Backend,
[src]
B: Backend,
fn new<N>(new_backend: N, batch_size: usize, concurrent: usize) -> Loader<B> where
N: NewBackend<Backend = B> + 'static,
[src]
N: NewBackend<Backend = B> + 'static,
Create new loader
concurrent
sets the number of threads which runs the backend.
new_backend
will be called in spawning the new thread.
fn load(
&self,
key: <B::Value as Value>::Key
) -> Result<Receiver<Result<Option<<B as Backend>::Value>, <B as Backend>::Error>>, SendError<<B::Value as Value>::Key>>
[src]
&self,
key: <B::Value as Value>::Key
) -> Result<Receiver<Result<Option<<B as Backend>::Value>, <B as Backend>::Error>>, SendError<<B::Value as Value>::Key>>
Load value by key
This function writes the key to the queue and returns a Future to wait the result.
Trait Implementations
impl<B: Clone> Clone for Loader<B> where
B: Backend,
[src]
B: Backend,