pub(crate) struct ChunkSchedulingCoordinator {
ticket_ingress: SyncMutex<TicketOperationIngress>,
trackers: SyncMutex<ChunkSchedulingTrackers>,
committed_receipt: AtomicU64,
}Expand description
Owns authoritative ticket sources and their two propagation trackers.
Gameplay submissions only lock ingress. Update propagation locks trackers first, snapshots both source projections under ingress, then releases ingress before either tracker propagates.
Fields§
§ticket_ingress: SyncMutex<TicketOperationIngress>§trackers: SyncMutex<ChunkSchedulingTrackers>§committed_receipt: AtomicU64Implementations§
Source§impl ChunkSchedulingCoordinator
impl ChunkSchedulingCoordinator
pub fn new( ticket_storage: ChunkTicketStorage, view_distance: u8, simulation_distance: u8, ) -> Self
pub(crate) fn queue_player_ticket_operation( &self, operation: PlayerTicketOperation, ) -> ChunkTicketReceipt
pub(crate) fn queue_player_ticket_operations( &self, operations: impl IntoIterator<Item = PlayerTicketOperation>, ) -> Option<ChunkTicketReceipt>
pub(crate) fn acquire_chunk_request_leases( &self, positions: impl IntoIterator<Item = ChunkPos>, ticket_level: ChunkTicketLevel, ) -> Option<ChunkTicketReceipt>
pub(crate) fn release_chunk_request_leases( &self, positions: impl IntoIterator<Item = ChunkPos>, ticket_level: ChunkTicketLevel, ) -> Option<ChunkTicketReceipt>
pub fn run_all_updates( &self, view_distance: u8, simulation_distance: u8, ) -> ChunkSchedulingUpdateBatch
pub(crate) fn add_or_refresh_portal_ticket(&self, pos: ChunkPos)
pub(crate) fn add_or_refresh_ender_pearl_ticket(&self, pos: ChunkPos)
pub(crate) fn timed_ticket_expirations(&self) -> Vec<TimedTicketExpiration>
pub(crate) fn tick_timed_tickets(&self, expirations: &[TimedTicketExpiration])
pub(crate) fn persistent_chunk_tickets(&self) -> PersistentChunkTickets
pub fn simulation_level(&self, pos: ChunkPos) -> Option<ChunkTicketLevel>
pub fn recycle_update_batch(&self, batch: ChunkSchedulingUpdateBatch)
pub fn publish_committed(&self, receipt: ChunkTicketReceipt)
pub fn is_receipt_committed(&self, receipt: ChunkTicketReceipt) -> bool
Auto Trait Implementations§
impl !Freeze for ChunkSchedulingCoordinator
impl !RefUnwindSafe for ChunkSchedulingCoordinator
impl Send for ChunkSchedulingCoordinator
impl Sync for ChunkSchedulingCoordinator
impl Unpin for ChunkSchedulingCoordinator
impl UnsafeUnpin for ChunkSchedulingCoordinator
impl UnwindSafe for ChunkSchedulingCoordinator
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<>>