pub struct Pipeline { /* private fields */ }Expand description
Top-level non-blocking pipeline. Owns all three queue handles and the gauge tracking total in-flight work.
Constructed via Self::start, which spawns one worker task per
queue. Drop the Pipeline to signal shutdown — workers exit as
soon as their queues drain.
Implementations§
Source§impl Pipeline
impl Pipeline
Sourcepub fn start(
config: PipelineConfig,
system: Arc<ConversationMemorySystem>,
) -> Pipeline
pub fn start( config: PipelineConfig, system: Arc<ConversationMemorySystem>, ) -> Pipeline
Spawn worker tasks and return a handle. Uses the current Tokio
runtime via tokio::spawn — must be called from inside an
async context.
system is shared with every worker so they can call into the
canonical *_now helpers on ConversationMemorySystem without
reimplementing the load → mutate → CAS → persist flow.
Sourcepub fn backlog(&self) -> usize
pub fn backlog(&self) -> usize
Returns a snapshot of the total number of work items currently queued across all pipeline queues. Used by the health endpoint to surface backlog pressure.
Sourcepub fn submit_embedding(
&self,
item: EmbeddingWorkItem,
) -> Result<(), PipelineError>
pub fn submit_embedding( &self, item: EmbeddingWorkItem, ) -> Result<(), PipelineError>
Submit an embedding-compute request. Non-blocking — returns
PipelineError::Backpressure immediately if the queue is
full.
Sourcepub fn submit_graph(&self, item: GraphWorkItem) -> Result<(), PipelineError>
pub fn submit_graph(&self, item: GraphWorkItem) -> Result<(), PipelineError>
Submit an entity-graph upsert.
Sourcepub fn submit_summary(&self, item: SummaryWorkItem) -> Result<(), PipelineError>
pub fn submit_summary(&self, item: SummaryWorkItem) -> Result<(), PipelineError>
Submit a summary-refresh request.
Sourcepub fn embedding_queue(&self) -> &EmbeddingQueue
pub fn embedding_queue(&self) -> &EmbeddingQueue
Borrow individual queue handles (test / advanced use).
Sourcepub fn graph_queue(&self) -> &GraphQueue
pub fn graph_queue(&self) -> &GraphQueue
Borrow the graph queue handle (test / advanced use).
Sourcepub fn summary_queue(&self) -> &SummaryQueue
pub fn summary_queue(&self) -> &SummaryQueue
Borrow the summary queue handle (test / advanced use).
Auto Trait Implementations§
impl Freeze for Pipeline
impl RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request