mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Removed unnecessary clutter
This commit is contained in:
parent
62c3503abb
commit
c4c65027dd
@ -13,11 +13,6 @@ class LibeventReactor implements Reactor {
|
||||
private $gcEvent;
|
||||
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() {
|
||||
$this->lastWatcherId = PHP_INT_MAX * -1;
|
||||
$this->base = event_base_new();
|
||||
@ -85,7 +80,6 @@ class LibeventReactor implements Reactor {
|
||||
|
||||
$watcher = new LibeventWatcher;
|
||||
$watcher->id = $watcherId;
|
||||
$watcher->type = self::$TYPE_ONCE;
|
||||
$watcher->eventResource = $eventResource;
|
||||
$watcher->interval = $delay;
|
||||
$watcher->callback = $callback;
|
||||
@ -123,11 +117,9 @@ class LibeventReactor implements Reactor {
|
||||
|
||||
$watcher = new LibeventWatcher;
|
||||
$watcher->id = $watcherId;
|
||||
$watcher->type = self::$TYPE_REPEATING;
|
||||
$watcher->eventResource = $eventResource;
|
||||
$watcher->interval = $interval;
|
||||
$watcher->callback = $callback;
|
||||
$watcher->isRepeating = true;
|
||||
|
||||
$watcher->wrapper = $this->wrapRepeatingCallback($watcher);
|
||||
|
||||
@ -171,9 +163,7 @@ class LibeventReactor implements Reactor {
|
||||
|
||||
$watcher = new LibeventWatcher;
|
||||
$watcher->id = $watcherId;
|
||||
$watcher->type = self::$TYPE_STREAM;
|
||||
$watcher->stream = $stream;
|
||||
$watcher->streamFlags = $flags;
|
||||
$watcher->callback = $callback;
|
||||
$watcher->wrapper = $this->wrapStreamCallback($watcher);
|
||||
$watcher->isEnabled = (bool) $enableNow;
|
||||
@ -210,7 +200,6 @@ class LibeventReactor implements Reactor {
|
||||
$eventResource = event_new();
|
||||
$watcher = new LibeventWatcher;
|
||||
$watcher->id = $watcherId;
|
||||
$watcher->type = self::$TYPE_SIGNAL;
|
||||
$watcher->eventResource = $eventResource;
|
||||
$watcher->callback = $callback;
|
||||
|
||||
|
@ -4,13 +4,10 @@ namespace Alert;
|
||||
|
||||
class LibeventWatcher {
|
||||
public $id;
|
||||
public $type;
|
||||
public $eventResource;
|
||||
public $stream;
|
||||
public $streamFlags;
|
||||
public $callback;
|
||||
public $wrapper;
|
||||
public $interval = -1;
|
||||
public $isEnabled = TRUE;
|
||||
public $isRepeating = FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user