pub struct ShuffleSender { /* private fields */ }Expand description
Lazy pool of outbound client-streaming calls, keyed by peer id.
Implementations§
Source§impl ShuffleSender
impl ShuffleSender
Sourcepub fn new(local_id: ShufflePeerId) -> Self
pub fn new(local_id: ShufflePeerId) -> Self
Empty sender. Peers are added via Self::register_peer or discovered
via the KV (in Self::with_kv) before any send_to.
Sourcepub fn with_kv(local_id: ShufflePeerId, kv: Arc<dyn ClusterKv>) -> Self
pub fn with_kv(local_id: ShufflePeerId, kv: Arc<dyn ClusterKv>) -> Self
Sender that falls back to kv (key SHUFFLE_ADDR_KEY on the peer’s
own state) when send_to targets a peer not previously registered.
Sourcepub async fn register_peer(&self, peer: ShufflePeerId, addr: SocketAddr)
pub async fn register_peer(&self, peer: ShufflePeerId, addr: SocketAddr)
Register (or update) a peer’s shuffle address.
Sourcepub async fn send_to(
&self,
peer: ShufflePeerId,
msg: &ShuffleMessage,
) -> Result<()>
pub async fn send_to( &self, peer: ShufflePeerId, msg: &ShuffleMessage, ) -> Result<()>
Send msg to peer, opening a client-streaming call if necessary.
§Errors
Returns io::Error when the peer is unregistered/undiscoverable, the
endpoint cannot be built, or the per-peer stream has shut down.
Sourcepub async fn fan_out_barrier(
&self,
peers: &[ShufflePeerId],
barrier: CheckpointBarrier,
) -> Result<()>
pub async fn fan_out_barrier( &self, peers: &[ShufflePeerId], barrier: CheckpointBarrier, ) -> Result<()>
Ship barrier to every peer in order, short-circuiting on the first
failure (the gossip side-channel is authoritative, so a partial
fan-out is tolerable).
§Errors
Returns the first io::Error from any peer’s send_to.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ShuffleSender
impl !RefUnwindSafe for ShuffleSender
impl !UnwindSafe for ShuffleSender
impl Send for ShuffleSender
impl Sync for ShuffleSender
impl Unpin for ShuffleSender
impl UnsafeUnpin for ShuffleSender
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].