pub struct ChannelStreamSource { /* private fields */ }Expand description
Bridges LaminarDB’s push-based Reactor and DataFusion’s pull-based
query execution. The sender is take-once (not cloned) so dropping
it closes the channel and lets the query terminate.
Implementations§
Source§impl ChannelStreamSource
impl ChannelStreamSource
Sourcepub fn new(schema: SchemaRef) -> Self
pub fn new(schema: SchemaRef) -> Self
Creates a new channel stream source with default capacity.
Sourcepub fn with_capacity(schema: SchemaRef, capacity: usize) -> Self
pub fn with_capacity(schema: SchemaRef, capacity: usize) -> Self
Creates a new channel stream source with the given channel capacity.
Sourcepub fn with_ordering(self, ordering: Vec<SortColumn>) -> Self
pub fn with_ordering(self, ordering: Vec<SortColumn>) -> Self
Declares that this source produces data in the given sort order.
When set, DataFusion can elide SortExec for ORDER BY queries
that match the declared ordering.
Sourcepub fn take_sender(&self) -> Option<BridgeSender>
pub fn take_sender(&self) -> Option<BridgeSender>
Takes the sender for pushing batches into this source.
This method can only be called once. The sender is moved out of the source to ensure the caller has full ownership and can close the channel by dropping the sender.
The returned sender can be cloned to allow multiple producers.
Returns None if the sender was already taken.
Sourcepub fn sender(&self) -> Option<BridgeSender>
pub fn sender(&self) -> Option<BridgeSender>
Returns a clone of the sender if it hasn’t been taken yet.
Warning: Using this method can lead to channel leak issues if
the original sender is never dropped. Prefer take_sender() for
proper channel lifecycle management.
Sourcepub fn reset(&self) -> BridgeSender
pub fn reset(&self) -> BridgeSender
Resets the source with a new bridge and sender.
This is useful when you need to reuse the source after the previous stream has been consumed. Any data sent before the reset but not yet consumed will be lost.
Returns the new sender.
Trait Implementations§
Source§impl Debug for ChannelStreamSource
impl Debug for ChannelStreamSource
Source§impl StreamSource for ChannelStreamSource
impl StreamSource for ChannelStreamSource
Source§fn schema(&self) -> SchemaRef
fn schema(&self) -> SchemaRef
Source§fn output_ordering(&self) -> Option<Vec<SortColumn>>
fn output_ordering(&self) -> Option<Vec<SortColumn>>
Auto Trait Implementations§
impl !Freeze for ChannelStreamSource
impl !RefUnwindSafe for ChannelStreamSource
impl !UnwindSafe for ChannelStreamSource
impl Send for ChannelStreamSource
impl Sync for ChannelStreamSource
impl Unpin for ChannelStreamSource
impl UnsafeUnpin for ChannelStreamSource
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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>
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 more§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].