pub struct Pipeline { /* private fields */ }Expand description
Bounded experience pipeline for decoupled collection and training.
Uses a crossbeam bounded channel internally, providing backpressure when
the learner falls behind the collector. The capacity controls how many
RolloutBatches can be buffered before the sender blocks.
Implementations§
Source§impl Pipeline
impl Pipeline
Sourcepub fn send(&self, batch: RolloutBatch) -> Result<(), RloxError>
pub fn send(&self, batch: RolloutBatch) -> Result<(), RloxError>
Send a batch into the pipeline (blocks if full).
Sourcepub fn try_send(&self, batch: RolloutBatch) -> Result<(), RloxError>
pub fn try_send(&self, batch: RolloutBatch) -> Result<(), RloxError>
Try to send a batch without blocking. Returns Ok(()) on success,
Err with the batch if the channel is full or disconnected.
Sourcepub fn recv(&self) -> Result<RolloutBatch, RloxError>
pub fn recv(&self) -> Result<RolloutBatch, RloxError>
Receive a batch (blocks until one is available).
Sourcepub fn try_recv(&self) -> Option<RolloutBatch>
pub fn try_recv(&self) -> Option<RolloutBatch>
Try to receive a batch without blocking.
Sourcepub fn sender(&self) -> Sender<RolloutBatch>
pub fn sender(&self) -> Sender<RolloutBatch>
Get a clone of the sender (for use in collector threads).
Sourcepub fn receiver(&self) -> Receiver<RolloutBatch>
pub fn receiver(&self) -> Receiver<RolloutBatch>
Get a clone of the receiver (for use in learner threads).
Auto Trait Implementations§
impl Freeze for Pipeline
impl RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnwindSafe for Pipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more