-
-
Notifications
You must be signed in to change notification settings - Fork 132
Remove nextTick() and NextTickQueue #30
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
Conversation
For the reference, both queues have been implemented by @jmalloc via reactphp/reactphp#234 and reactphp/reactphp#249 respectively. Let's ping @jmalloc, perhaps you can share your view on this? The latter also has some discussion on this:
Long story short, cooperative multitasking will likely depend on There's also some confusion about this topic in #28. I'm still curious if we have a valid use case for For what it's worth, nodejs also has:
|
Afaict there's also debate about which function should be used, e.g. see http://stackoverflow.com/a/15349865 I'm well aware of the differences between both functions. However, I have yet to find a valid use case for |
👍 on removing next ticks, it just adds confusion without a real good use case for keeping them |
I can't see any immediate reason to retain |
I'd also like to add that I was never quite happy with the name |
I'm with @jmalloc renaming |
I'm ok with renaming and |
That's a valid concern for sure. I still personally prefer |
I'm with @cboden regarding the potential confusion of using Back to the initial scope of this PR, I'm still torn about removing |
Ye old thesaurus came up with a few options, my top ones:
I agree that |
For me both enqueue or schedule would work
|
The term As a non experienced user of reactphp (I started to read the code last week), my first thought after read |
👍 for removing |
I just noticed that I used |
Btw, the async-interop loop also uses |
Technically, this PR is a BC break and if we are to accept this, this will be part of the upcoming v0.5 release. However, I would vote for keeping the method names as-is for now at least. If we are to accept this PR, then we'll remove Empirical evidence seems to suggest that:
This means that while this PR is a BC break, most consumers of this library are likely compatible with the current v0.4 as well as the upcoming v0.5 release. I'm not saying |
@clue Good point, agreed. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…her details are below. Also cleaned up composer.json so we don't import the entirety of ReactPHP, but rather only the parts we actually need. The following changes were made to PHPCraft due to API changes and/or deprecations in ReactPHP: ・MultiplayerServer: [API breaking change as of 0.5.0] ReactPHP Socket listen() has been removed, with its functionality moved to the Server constructor. As such, the Server constructor format also changed, and its call location had to be moved in PHPCraft's code. — see https://github.com/reactphp/socket/releases/tag/v0.5.0 ・MultiplayerServer, EntityManager: [API breaking change as of 0.5.0] ReactPHP EventLoop's nextTick() has been removed and replaced by futureTick() — see https://github.com/reactphp/event-loop/releases/tag/v0.5.0 and reactphp/event-loop#30 ・MultiplayerServer: [API deprecation as of 1.2.0] ReactPHP EventLoop's Factory::create() has been deprecated and replaced by Loop::get() — see https://github.com/reactphp/event-loop/releases/tag/v1.2.0
…her details are below. Also cleaned up composer.json so we don't import the entirety of ReactPHP, but rather only the parts we actually need. The following changes were made to PHPCraft due to API changes and/or deprecations in ReactPHP: ・MultiplayerServer: [API breaking change as of 0.5.0] ReactPHP Socket listen() has been removed, with its functionality moved to the Server constructor. As such, the Server constructor format also changed, and its call location had to be moved in PHPCraft's code. — see https://github.com/reactphp/socket/releases/tag/v0.5.0 ・MultiplayerServer, EntityManager: [API breaking change as of 0.5.0] ReactPHP EventLoop's nextTick() has been removed and replaced by futureTick() — see https://github.com/reactphp/event-loop/releases/tag/v0.5.0 and reactphp/event-loop#30 ・MultiplayerServer: [API deprecation as of 1.2.0] ReactPHP EventLoop's Factory::create() has been deprecated and replaced by Loop::get() — see https://github.com/reactphp/event-loop/releases/tag/v1.2.0
This PR is a RFC – any input is welcome.v0.4 introduced both "future ticks" and "next ticks".
This PR aims to serve as a discussion basis whether it actually makes sense to keep both.Edit: This PR removes the
nextTick()
method and its underlyingNextTickQueue
implementation. Use thefutureTick()
method instead.