Function hopper::channel_with_explicit_capacity [] [src]

pub fn channel_with_explicit_capacity<T>(
    name: &str,
    data_dir: &Path,
    max_memory_bytes: usize,
    max_disk_bytes: usize,
    max_disk_files: usize
) -> Result<(Sender<T>, Receiver<T>), Error> where
    T: Serialize + DeserializeOwned

Create a (Sender, Reciever) pair in a like fashion to std::sync::mpsc::channel

This function creates a Sender and Receiver pair with name name whose queue files are stored in data_dir. The maximum number of bytes that will be stored in-memory are max(max_memory_bytes, size_of(T)) and the maximum size of a queue file will be max(max_disk_bytes, 1Mb). max_disk_files sets the total number of concurrent queue files which are allowed to exist. The total on-disk consumption of hopper will then be max(max_memory_bytes, size_of(T)) * max_disk_files.

The Sender is clonable.