Struct yaque::queue::ReceiverBuilder [−][src]
pub struct ReceiverBuilder { /* fields omitted */ }
Expand description
A builder for the receiver side of the queue. Use this if you want to have fine-grained control over the configuration of the queue. Most defaults should be ok of most applications.
Implementations
impl ReceiverBuilder
[src]
impl ReceiverBuilder
[src]pub fn new() -> ReceiverBuilder
[src]
pub fn save_every_nth(self, nth: Option<usize>) -> ReceiverBuilder
[src]
pub fn save_every_nth(self, nth: Option<usize>) -> ReceiverBuilder
[src]Sets the receiver to save its state to the disk at every n-th element.
Set it to None
to disable this policy.
Default value: every 250 elements.
pub fn save_every(self, duration: Option<Duration>) -> ReceiverBuilder
[src]
pub fn save_every(self, duration: Option<Duration>) -> ReceiverBuilder
[src]Sets the receiver to save ir state to the disk at every given interval
of time. Set it to None
to disable this policy.
Default value: every 350 milliseconds.
Note:
This policy is enforced synchronously. This means that there is no asynchronous behavior involved (i.e. timers). This condidition will only be checked when a new element is pushed to the queue.
pub fn open<P: AsRef<Path>>(self, base: P) -> Result<Receiver>
[src]
pub fn open<P: AsRef<Path>>(self, base: P) -> Result<Receiver>
[src]Opens a queue for reading. The access will be exclusive, based on the
existence of the temporary file recv.lock
inside the queue folder.
Errors
This function will return an IO error if the queue is already in use for receiving, which is indicated by a lock file. Also, any other IO error encountered while opening will be sent.
Panics
This function will panic if it is not able to set up the notification handler to watch for file changes.
Trait Implementations
impl Default for ReceiverBuilder
[src]
impl Default for ReceiverBuilder
[src]fn default() -> ReceiverBuilder
[src]
fn default() -> ReceiverBuilder
[src]Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ReceiverBuilder
impl Send for ReceiverBuilder
impl Sync for ReceiverBuilder
impl Unpin for ReceiverBuilder
impl UnwindSafe for ReceiverBuilder
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,