pub struct StreamExecutor { /* private fields */ }Expand description
Executes streaming operations with bounded concurrency.
Construct via StorageService::stream,
which pre-acquires the concurrency window from the service’s available permits.
See the module documentation for a full description of the window calculation, permit reservation, and concurrency model.
Implementations§
Source§impl StreamExecutor
impl StreamExecutor
Sourcepub fn execute<E>(
self,
context: ObjectContext,
operations: impl Stream<Item = (usize, Result<Operation, E>)> + Send + 'static,
) -> impl Stream<Item = (usize, Result<OpResponse, E>)> + Send + 'static
pub fn execute<E>( self, context: ObjectContext, operations: impl Stream<Item = (usize, Result<Operation, E>)> + Send + 'static, ) -> impl Stream<Item = (usize, Result<OpResponse, E>)> + Send + 'static
Executes the operations stream with bounded concurrency.
Each item is a (index, Result<Operation, E>) tuple where index is the
0-based position of the operation in the original request. Error items pass
through immediately; successful items are executed concurrently up to window
at a time, each in an isolated [tokio::spawn].
Results are yielded in completion order (not submission order). The permit reservation is held until every spawned task has completed — if the stream is dropped early, in-flight tasks run to completion before the permits are released.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamExecutor
impl !RefUnwindSafe for StreamExecutor
impl Send for StreamExecutor
impl Sync for StreamExecutor
impl Unpin for StreamExecutor
impl !UnwindSafe for StreamExecutor
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].