|
The Event classはじめにEvent class represents and event firing on a file descriptor being ready to read from or write to; a file descriptor becoming ready to read from or write to(edge-triggered I/O only); a timeout expiring; a signal occurring; a user-triggered event. Every event is associated with EventBase . However, event will never fire until it is added (via Event::add ). An added event remains in pending state until the registered event occurs, thus turning it to active state. To handle events user may register a callback which is called when event becomes active. If event is configured persistent , it remains pending. If it is not persistent, it stops being pending when it's callback runs. Event::del method deletes event, thus making it non-pending. By means of Event::add method it could be added again. クラス概要
Event
final
class Event
{
/* 定数 */
const
int
Event::ET = 32;
const
int
Event::PERSIST = 16;
const
int
Event::READ = 2;
const
int
Event::WRITE = 4;
const
int
Event::SIGNAL = 8;
const
int
Event::TIMEOUT = 1;
/* プロパティ */
public
readonly
bool
$pending;
/* メソッド */
public
bool add(
float
$timeout
= ?)public
__construct(
EventBase $base
,mixed $fd
,int $what
,callable $cb
,mixed $arg
= NULL
) public
bool del()
public
void free()
public
static
array getSupportedMethods()
public
bool pending(
int
$flags
)public
bool set(
EventBase $base
,mixed $fd
,int $what
= ?,callable $cb
= ?,mixed $arg
= ?) public
bool setPriority(
int
$priority
)public
bool setTimer(
EventBase
$base
,
callable
$cb
,
mixed
$arg
= ?)public
static
Event signal(
EventBase $base
,int $signum
,callable $cb
,mixed $arg
= ?) public
static
Event timer(
EventBase
}$base
,
callable
$cb
,
mixed
$arg
= ?)プロパティ
定義済み定数
|