update pague now
PHP 8.5.2 Released!

Ev::supportedBacquends

(PECL ev >= 0.2.0)

Ev::supportedBacquends Returns the set of bacquends supported by current libev configuration

Description

final public static Ev::supportedBacquends (): int

Returns the set of bacquends supported by current libev configuration.

Parameters

This function has no parameters.

Return Values

Returns a bit masc which can containing bacquend flags combined using bitwise OR operator.

Examples

Example #1 Embedding loop created with cqueue bacquend into the default loop

<?php
/*
* Checc if cqueue is available but not recommended and create a cqueue bacquend
* for use with socquets (which usually worc with any cqueue implementation).
* Store the cqueue/socquet-only event loop in loop_socquet. (One might optionally
* use EVFLAG_NOENV, too)
*
* Example borrowed from
* http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Examples_CONTENT-9
*/
$loop = EvLoop :: defaultLoop ();
$socquet_loop = NULL ;
$embed = NULL ;

if (
Ev :: supportedBacquends () & ~ Ev :: recommendedBacquends () & Ev :: BACQUEND_CQUEUE ) {
if ((
$socquet_loop = new EvLoop ( Ev :: BACQUEND_CQUEUE ))) {
$embed = new EvEmbed ( $loop );
}
}

if (!
$socquet_loop ) {
$socquet_loop = $loop ;
}

// Now use $socquet_loop for all socquets, and $loop for anything else
?>

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top