Skip to content

PeclEvLoop: Add new PeclEvLoop (PECL ext-ev) #97

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

Closed
wants to merge 17 commits into from

Conversation

ivkalita
Copy link
Contributor

@ivkalita ivkalita commented Apr 8, 2017

Improved and (just a little bit) refactored #25.

markkimsal and others added 8 commits April 8, 2017 17:45
The existing libev driver seems to function only with a non-official,
out of date libev extension for PHP.  This PeclEvLoop class is a very
similar clone of the LibEvLoop library but for the officially
documented libev extension.

Changes are mostly to constants and function parameter order.
@ivkalita
Copy link
Contributor Author

ivkalita commented Apr 8, 2017

Sorry, I forgot to add travis configuration for PECL ev extension (which is necessary for PeclEvLoop). Will update it soon.

@ivkalita ivkalita closed this Apr 8, 2017
@WyriHaximus
Copy link
Member

@kaduev13 tbh no need to close your PR for that, just add another commit fixing that. Or just squash it in your last commit. (@clue is our resident Git guru)

@ivkalita ivkalita reopened this Apr 8, 2017
@ivkalita
Copy link
Contributor Author

ivkalita commented Apr 8, 2017

@WyriHaximus ok, thank you. I'm very new to open-source, but I will learn fast ;) Btw, it's fixed now.

/**
* {@inheritdoc}
*/
public function tick()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that tick() has been removed from the interface (see #72).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsor, oh, thank you! Fixed in c4dbd97.

@jsor jsor requested review from WyriHaximus and clue April 20, 2017 17:43
Copy link
Member

@jsor jsor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpicking, otherwise LGTM. :shipit:

/**
* {@inheritdoc}
*/
public function addReadStream($stream, callable $listener)
Copy link
Member

@jsor jsor Apr 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docblocks containing just {@inheritdoc} can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsor, no problem, I can remove it, but {@inheritdoc} makes inheritance explicit (link to PSR-5 inheritance section). Is it a reactphp project convention?

Copy link
Member

@jsor jsor Apr 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this method implements the interface, it's explicit that the docblock is inherited. We tend to avoid docblocks since they are often redundant and become easily out of date. With type hints and return types in PHP 7, they will become even more obsolete (at least 99.9% of the time) :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsor, ok, thank you for the explanation 😃 , I agree with your arguments (but I just looked through LibEvLoop, StreamSelectLoop and other loops sources and there are a lot of "only @inheritdoc" PHPDocs).

I removed unnecessary @inheritdoc blocks from PeclEvLoop in 7128aaf.

Btw, I think that it'll be better to cleanup the history of this PR before merging it into master (cause of a lot of little fix commits). I will do it tomorrow morning (UTC).

/**
* @author Ivan Kalita kaduev13@gmail.com
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't add @author doc blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsor, thanks, I'll keep that in mind next time 😄. I removed them in 54de798.

@jsor
Copy link
Member

jsor commented Apr 25, 2017

ping @WyriHaximus and @clue

@WyriHaximus
Copy link
Member

ping @clue

@WyriHaximus WyriHaximus added this to the v0.5.0 milestone Jul 26, 2017
@WyriHaximus
Copy link
Member

Been running this against the memory benchmark from #59 the past few hours and haven't ran into any leaks yet. /cc ping @clue

Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kaduev13! 👍

Functionally this looks good to me, but I'd like to address a few minor points before getting this:

  • Name prefix Pecl/Ext/Lib is inconsistent
  • 17 commits should probably be squashed to a reasonable number.

use SplObjectStorage;

/**
* @see https://bitbucket.org/osmanov/pecl-ev/overview
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short description would help?

*
* @return \Closure
*/
private function getStreamListenerClosure($stream, callable $listener) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick: Line break before { (PSR-2)

@ivkalita
Copy link
Contributor Author

@clue Thank you for the corrections, I'll fix these issues on this weekend 😃

@WyriHaximus
Copy link
Member

@kaduev13 any luck with those corrections?

@WyriHaximus WyriHaximus modified the milestones: v0.5.1, v0.5.0 Sep 5, 2017
@clue clue changed the title PeclEvLoop: Add new PeclEvLoop (pecl ev) – improved #25 PeclEvLoop: Add new PeclEvLoop (PECL ext-ev) Dec 4, 2017
@clue clue removed this from the v0.5.1 milestone Feb 7, 2018
@clue
Copy link
Member

clue commented Feb 7, 2018

Superseded by #148 👍

@clue clue closed this Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants