pub trait Dispatcher: Debug + 'static {
// Required methods
fn dispatch_data(&mut self, chunk: StreamChunk) -> impl DispatchFuture<'_>;
fn dispatch_barrier(
&mut self,
barrier: DispatcherBarrier,
) -> impl DispatchFuture<'_>;
fn dispatch_watermark(
&mut self,
watermark: Watermark,
) -> impl DispatchFuture<'_>;
fn add_outputs(&mut self, outputs: impl IntoIterator<Item = BoxedOutput>);
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_barrier(
&mut self,
barrier: DispatcherBarrier,
) -> impl DispatchFuture<'_>
fn dispatch_barrier( &mut self, barrier: DispatcherBarrier, ) -> impl DispatchFuture<'_>
Dispatch a barrier 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 = BoxedOutput>)
fn add_outputs(&mut self, outputs: impl IntoIterator<Item = BoxedOutput>)
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
.
Object Safety§
This trait is not object safe.