pub struct ShuffleReceiver { /* private fields */ }Expand description
Inbound side of the shuffle fabric.
Binds a TcpListener and surfaces every frame received from any
peer — prefixed with that peer’s id — on the subscribe channel.
Implementations§
Source§impl ShuffleReceiver
impl ShuffleReceiver
Sourcepub async fn bind(local_id: ShufflePeerId, addr: SocketAddr) -> Result<Self>
pub async fn bind(local_id: ShufflePeerId, addr: SocketAddr) -> Result<Self>
Bind on addr and start accepting peer connections. The bound
socket address is surfaced via Self::local_addr so callers
using an ephemeral port can register themselves with peers.
§Errors
Returns io::Error on bind failure.
Sourcepub async fn bind_with_kv(
local_id: ShufflePeerId,
addr: SocketAddr,
kv: Arc<dyn ClusterKv>,
) -> Result<Self>
pub async fn bind_with_kv( local_id: ShufflePeerId, addr: SocketAddr, kv: Arc<dyn ClusterKv>, ) -> Result<Self>
Bind + publish the listener’s address into kv under
SHUFFLE_ADDR_KEY so that peer ShuffleSenders can
discover us via ShuffleSender::with_kv.
§Errors
Returns io::Error on bind failure.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Local socket address the listener is bound to.
Sourcepub async fn recv(&self) -> Option<(ShufflePeerId, ShuffleMessage)>
pub async fn recv(&self) -> Option<(ShufflePeerId, ShuffleMessage)>
Await the next (peer_id, msg) from any connected peer.
Sourcepub fn drain_available(&self) -> Vec<(ShufflePeerId, ShuffleMessage)>
pub fn drain_available(&self) -> Vec<(ShufflePeerId, ShuffleMessage)>
Drain every currently-available (peer_id, msg) without blocking.
Returns immediately when the internal queue is empty.
Used by the row-shuffle aggregator path to pull remote rows into
the current streaming cycle without waiting for more. Uses
tokio::sync::Mutex::try_lock so a concurrent recv() doesn’t
block us — we just skip this tick when contended (next tick picks
up the messages).
Trait Implementations§
Source§impl Debug for ShuffleReceiver
impl Debug for ShuffleReceiver
Auto Trait Implementations§
impl !Freeze for ShuffleReceiver
impl !RefUnwindSafe for ShuffleReceiver
impl Send for ShuffleReceiver
impl Sync for ShuffleReceiver
impl Unpin for ShuffleReceiver
impl UnsafeUnpin for ShuffleReceiver
impl !UnwindSafe for ShuffleReceiver
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