PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Real time scheduler

Open SOF3 opened this issue 2 years ago • 0 comments

Description

A scheduler that allows scheduling tasks using real time units instead of ticks.

Justification

Tick scheduler is subject to server TPS change. While tick scheduling may be desirable for simple async deferment, scheduling more than a few ticks most often implies user wants to schedule using real time instead.

Alternative methods

Real time scheduling can be emulated by a repeating task at a smaller frequency that checks if current real time has reached the desired timeout, but this means every tick would be O(n) where n is the number of scheduled real time tasks. A specialized heap for scheduling real time tasks avoids this unnecessary overhead.

SOF3 avatar Aug 09 '22 06:08 SOF3