final class EventBase (View source)

EventBase.

EventBase class represents libevent's event base structure. It holds a set of events and can poll to determine which events are active. Each event base has a method, or a backend that it uses to determine which events are ready. The recognized methods are: select, poll, epoll, kqueue, devpoll, evport and win32 . To configure event base to use, or avoid specific backend EventConfig class can be used.

Constants

LOOP_ONCE

LOOP_NONBLOCK

NOLOCK

STARTUP_IOCP

NO_CACHE_TIME

EPOLL_USE_CHANGELIST

IGNORE_ENV

PRECISE_TIMER

Methods

__construct(EventConfig|null $cfg = null)

__construct.

void
dispatch()

dispatch.

bool
exit(float $timeout = 0.0)

exit.

void
free()

free.

int
getFeatures()

getFeatures.

string
getMethod()

getMethod.

float
getTimeOfDayCached()

getTimeOfDayCached.

bool
gotExit()

gotExit.

bool
gotStop()

gotStop.

bool
loop(int $flags = -1)

loop.

bool
priorityInit(int $n_priorities)

priorityInit.

bool
reInit()

reInit.

bool
resume()

Tells event_base to resume previously stopped event

bool
stop()

stop.

bool
updateCacheTime()

Updates cache time

Details

__construct(EventConfig|null $cfg = null)

__construct.

Constructs EventBase object.

void dispatch()

dispatch.

Dispatch pending events.

bool exit(float $timeout = 0.0)

exit.

Stop dispatching events.

Parameters

float $timeout

Return Value

bool

See also

https://php.net/manual/en/eventbase.exit.php

void free()

free.

Free resources allocated for this event base.

int getFeatures()

getFeatures.

Returns bitmask of features supported.

string getMethod()

getMethod.

Returns event method in use.

float getTimeOfDayCached()

getTimeOfDayCached.

Returns the current event base time.

bool gotExit()

gotExit.

Checks if the event loop was told to exit.

bool gotStop()

gotStop.

Checks if the event loop was told to exit.

bool loop(int $flags = -1)

loop.

Dispatch pending events.

Parameters

int $flags

Return Value

bool

See also

https://php.net/manual/en/eventbase.loop.php

bool priorityInit(int $n_priorities)

priorityInit.

Sets number of priorities per event base.

Parameters

int $n_priorities

Return Value

bool

See also

https://php.net/manual/en/eventbase.priorityinit.php

bool reInit()

reInit.

Re]initialize event base(after a fork).

bool resume()

Since: libevent version 2.1.2-alpha

Tells event_base to resume previously stopped event

bool stop()

stop.

Tells event_base to stop dispatching events.

bool updateCacheTime()