mirror of
https://github.com/danog/amp.git
synced 2024-11-27 04:24:42 +01:00
a562d6b20f
Changed values of Watcher constants to match UV constants because it was easier that way. :-D
48 lines
842 B
PHP
48 lines
842 B
PHP
<?php
|
|
|
|
namespace Amp\Loop;
|
|
|
|
use Amp\Struct;
|
|
|
|
class Watcher {
|
|
use Struct;
|
|
|
|
const IO = 0b00000011;
|
|
const READABLE = 0b00000001;
|
|
const WRITABLE = 0b00000010;
|
|
const DEFER = 0b00000100;
|
|
const TIMER = 0b00011000;
|
|
const DELAY = 0b00001000;
|
|
const REPEAT = 0b00010000;
|
|
const SIGNAL = 0b00100000;
|
|
|
|
/** @var int */
|
|
public $type;
|
|
|
|
/** @var bool */
|
|
public $enabled = true;
|
|
|
|
/** @var bool */
|
|
public $referenced = true;
|
|
|
|
/** @var string */
|
|
public $id;
|
|
|
|
/** @var callable */
|
|
public $callback;
|
|
|
|
/**
|
|
* Data provided to the watcher callback.
|
|
*
|
|
* @var mixed
|
|
*/
|
|
public $data;
|
|
|
|
/**
|
|
* Watcher-dependent value storage. Stream for IO watchers, signal number for signal watchers, interval for timers.
|
|
*
|
|
* @var mixed
|
|
*/
|
|
public $value;
|
|
}
|