1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00

Removed unnecessary clutter

This commit is contained in:
Daniel Lowrey 2014-04-22 20:49:05 -04:00
parent 62c3503abb
commit c4c65027dd
2 changed files with 0 additions and 14 deletions

View File

@ -13,11 +13,6 @@ class LibeventReactor implements Reactor {
private $gcEvent; private $gcEvent;
private $stopException; private $stopException;
private static $TYPE_STREAM = 0;
private static $TYPE_ONCE = 1;
private static $TYPE_REPEATING = 2;
private static $TYPE_SIGNAL = 3;
public function __construct() { public function __construct() {
$this->lastWatcherId = PHP_INT_MAX * -1; $this->lastWatcherId = PHP_INT_MAX * -1;
$this->base = event_base_new(); $this->base = event_base_new();
@ -85,7 +80,6 @@ class LibeventReactor implements Reactor {
$watcher = new LibeventWatcher; $watcher = new LibeventWatcher;
$watcher->id = $watcherId; $watcher->id = $watcherId;
$watcher->type = self::$TYPE_ONCE;
$watcher->eventResource = $eventResource; $watcher->eventResource = $eventResource;
$watcher->interval = $delay; $watcher->interval = $delay;
$watcher->callback = $callback; $watcher->callback = $callback;
@ -123,11 +117,9 @@ class LibeventReactor implements Reactor {
$watcher = new LibeventWatcher; $watcher = new LibeventWatcher;
$watcher->id = $watcherId; $watcher->id = $watcherId;
$watcher->type = self::$TYPE_REPEATING;
$watcher->eventResource = $eventResource; $watcher->eventResource = $eventResource;
$watcher->interval = $interval; $watcher->interval = $interval;
$watcher->callback = $callback; $watcher->callback = $callback;
$watcher->isRepeating = true;
$watcher->wrapper = $this->wrapRepeatingCallback($watcher); $watcher->wrapper = $this->wrapRepeatingCallback($watcher);
@ -171,9 +163,7 @@ class LibeventReactor implements Reactor {
$watcher = new LibeventWatcher; $watcher = new LibeventWatcher;
$watcher->id = $watcherId; $watcher->id = $watcherId;
$watcher->type = self::$TYPE_STREAM;
$watcher->stream = $stream; $watcher->stream = $stream;
$watcher->streamFlags = $flags;
$watcher->callback = $callback; $watcher->callback = $callback;
$watcher->wrapper = $this->wrapStreamCallback($watcher); $watcher->wrapper = $this->wrapStreamCallback($watcher);
$watcher->isEnabled = (bool) $enableNow; $watcher->isEnabled = (bool) $enableNow;
@ -210,7 +200,6 @@ class LibeventReactor implements Reactor {
$eventResource = event_new(); $eventResource = event_new();
$watcher = new LibeventWatcher; $watcher = new LibeventWatcher;
$watcher->id = $watcherId; $watcher->id = $watcherId;
$watcher->type = self::$TYPE_SIGNAL;
$watcher->eventResource = $eventResource; $watcher->eventResource = $eventResource;
$watcher->callback = $callback; $watcher->callback = $callback;

View File

@ -4,13 +4,10 @@ namespace Alert;
class LibeventWatcher { class LibeventWatcher {
public $id; public $id;
public $type;
public $eventResource; public $eventResource;
public $stream; public $stream;
public $streamFlags;
public $callback; public $callback;
public $wrapper; public $wrapper;
public $interval = -1; public $interval = -1;
public $isEnabled = TRUE; public $isEnabled = TRUE;
public $isRepeating = FALSE;
} }