pub(super) struct PacketProcessor {
queued: PacketQueue<PlayerPacketLaneKey, PendingPlayPacket>,
}Expand description
Gameplay packets submitted by network tasks.
The processor runs while the game tick is idle. At each tick boundary it drains every packet submitted before that boundary, while retaining later submissions for the next packet phase.
Fields§
§queued: PacketQueue<PlayerPacketLaneKey, PendingPlayPacket>Implementations§
Source§impl PacketProcessor
impl PacketProcessor
pub(super) fn new() -> Self
pub(super) fn schedule( &self, player: Arc<Player>, packet: ScheduledPlayPacket, payload_bytes: usize, )
Sourcepub(super) fn run(&self, server: &Arc<Server>)
pub(super) fn run(&self, server: &Arc<Server>)
Runs the blocking packet worker until the processor is stopped.
fn packet_is_runnable( player: &Player, packet: &ScheduledPlayPacket, server_cancelled: bool, ) -> bool
Sourcepub(super) fn open_after_tick(&self)
pub(super) fn open_after_tick(&self)
Opens the inter-tick packet phase and wakes the worker.
Sourcepub(super) async fn wait_for_overload_progress(&self)
pub(super) async fn wait_for_overload_progress(&self)
Guarantees packet progress when a late tick leaves no normal inter-tick window.
Sourcepub(super) async fn close_for_tick(&self)
pub(super) async fn close_for_tick(&self)
Drains packets submitted before this tick boundary, then closes packet admission.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PacketProcessor
impl !RefUnwindSafe for PacketProcessor
impl !UnwindSafe for PacketProcessor
impl Send for PacketProcessor
impl Sync for PacketProcessor
impl Unpin for PacketProcessor
impl UnsafeUnpin for PacketProcessor
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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 moreWraps this value in an
Arc<SyncMutex<>>