RakLib icon indicating copy to clipboard operation
RakLib copied to clipboard

Improve ease of use without threads, get rid of ServerEventSource

Open dktapps opened this issue 1 year ago • 0 comments

this leaves the responsibility of reading packets and ticking the server up to the user, which allows for more dynamic ticking, custom sleep mechanisms (perhaps RakLib is to share a thread with something else), and easier API use when used without threads.

However it is somewhat less convenient in the sense that consumers of the library must now come up with their own ticking mechanism rather than having RakLib do it for them.

Not sure if this is finished or not, but it was made with the following issues in mind: pmmp/PocketMine-MP#6333 pmmp/PocketMine-MP#6294

Basically this means that tickProcessor() would be moved inline here: https://github.com/pmmp/PocketMine-MP/blob/06028aac97d876ce3ef249d64f70013b2f76d1c1/src/network/mcpe/raklib/RakLibServer.php#L106-L108

allowing more control over when the server sleeps and the way in which messages are delivered to the server instance

dktapps avatar Dec 03 '24 14:12 dktapps