Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ease of use without threads, get rid of ServerEventSource #230

Open
wants to merge 2 commits into
base: major-next
Choose a base branch
from

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Dec 3, 2024

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

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.
@dktapps dktapps requested a review from a team as a code owner December 3, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant