Skip to content

Conversation

@ivkalita
Copy link
Contributor

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

markkimsaland 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
ContributorAuthor

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

@ivkalitaivkalita 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)

@ivkalitaivkalita reopened this Apr 8, 2017
@ivkalita
Copy link
ContributorAuthor

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
ContributorAuthor

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.

@jsorjsor requested review from WyriHaximus and clueApril 20, 2017 17:43
Copy link
Member

@jsorjsor 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

@jsorjsorApr 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
ContributorAuthor

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

@jsorjsorApr 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
ContributorAuthor

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
ContributorAuthor

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

@WyriHaximusWyriHaximus 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

@clueclue 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
ContributorAuthor

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

@WyriHaximus
Copy link
Member

@kaduev13 any luck with those corrections?

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

clue commented Feb 7, 2018

Superseded by #148 👍

@clueclue closed this Feb 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ivkalita@WyriHaximus@jsor@clue@markkimsal