pub trait Dispatcher: Debug + 'static {
// Required methods
fn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>;
fn dispatch_barriers(
&mut self,
barrier: DispatcherBarriers,
) -> impl DispatchFuture<'_>;
fn dispatch_watermark(
&mut self,
watermark: Watermark,
) -> impl DispatchFuture<'_>;
fn add_outputs(&mut self, outputs: impl IntoIterator<Item = Output>);
fn remove_outputs(&mut self, actor_ids: &HashSet<ActorId>);
fn dispatcher_id(&self) -> DispatcherId;
fn dispatcher_id_str(&self) -> &str;
fn is_empty(&self) -> bool;
}Required Methods§
Sourcefn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>
fn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>
Dispatch a data chunk to downstream actors.
Sourcefn dispatch_barriers(
&mut self,
barrier: DispatcherBarriers,
) -> impl DispatchFuture<'_>
fn dispatch_barriers( &mut self, barrier: DispatcherBarriers, ) -> impl DispatchFuture<'_>
Dispatch barriers to downstream actors, generally by broadcasting it.
Sourcefn dispatch_watermark(
&mut self,
watermark: Watermark,
) -> impl DispatchFuture<'_>
fn dispatch_watermark( &mut self, watermark: Watermark, ) -> impl DispatchFuture<'_>
Dispatch a watermark to downstream actors, generally by broadcasting it.
Sourcefn add_outputs(&mut self, outputs: impl IntoIterator<Item = Output>)
fn add_outputs(&mut self, outputs: impl IntoIterator<Item = Output>)
Add new outputs to the dispatcher.
Sourcefn remove_outputs(&mut self, actor_ids: &HashSet<ActorId>)
fn remove_outputs(&mut self, actor_ids: &HashSet<ActorId>)
Remove outputs to actor_ids from the dispatcher.
Sourcefn dispatcher_id(&self) -> DispatcherId
fn dispatcher_id(&self) -> DispatcherId
The ID of the dispatcher. A DispatchExecutor may have multiple dispatchers with
different IDs.
Note that the dispatcher id is always equal to the downstream fragment id.
See also proto/stream_plan.proto.
Sourcefn dispatcher_id_str(&self) -> &str
fn dispatcher_id_str(&self) -> &str
Dispatcher id in string. See Dispatcher::dispatcher_id.
Sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Whether the dispatcher has no outputs. If so, it’ll be cleaned up from the
DispatchExecutor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.