Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from SelrahcD/dispatch-signal
Browse files Browse the repository at this point in the history
Dispatch signal
  • Loading branch information
Prophet777 committed Feb 26, 2016
2 parents b447a5a + c977c23 commit c4e3ecf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PnctlEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public function __construct(LoopInterface $loop, $interval = 0.1)
*/
public function on($signo, callable $listener)
{
pcntl_signal($signo, array($this, 'emit'));
pcntl_signal($signo, function($signo) {
$this->emit($signo, array($signo));
});

parent::on($signo, $listener);
}

Expand Down

0 comments on commit c4e3ecf

Please sign in to comment.