Ev::embeddableBackends

(PECL ev >= 0.2.0)

Ev::embeddableBackendsReturns the set of backends that are embeddable in other event loops

说明

final public static Ev::embeddableBackends ( void ) : void

Returns the set of backends that are embeddable in other event loops.

参数

此函数没有参数。

返回值

Returns a bit mask which can containing backend flags combined using bitwise OR operator.

范例

Example #1 Embedding loop created with kqueue backend into the default loop

<?php
/*
* Check if kqueue is available but not recommended and create a kqueue backend
* for use with sockets (which usually work with any kqueue implementation).
* Store the kqueue/socket-only event loop in loop_socket. (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();
$socket_loop NULL;
$embed       NULL;

if (
Ev::supportedBackends() & ~Ev::recommendedBackends() & Ev::BACKEND_KQUEUE) {
 if ((
$socket_loop = new EvLoop(Ev::BACKEND_KQUEUE))) {
  
$embed = new EvEmbed($loop);
 }
}

if (!
$socket_loop) {
 
$socket_loop $loop;
}

// Now use $socket_loop for all sockets, and $loop for anything else
?>

参见

相关文章
php set creates a new set using values that aren t in another setphp set returns a representation that can be converted to jsonphp set returns a sorted copyphp vector returns a representation that can be converted to jsonphp ev returns the set of backends that are embeddable in other event loopsphp ev returns the time when the last iteration of the default event loop has startedphp ev returns a bit mask of recommended backends for current platformphp ev returns the set of backends supported by current libev configurationphp eventbufferevent returns underlying output buffer associated with current buffer eventphp ibm db2 函数 returns a result set listing the columns and associated metadata for a tablephp ibm db2 函数 returns the position of the named column in a result setphp imap 函数 returns all of the imap errors that have occurredphp oci8 函数 returns the next child statement resource from a parent statement resource that has oracle database 12c implicit result setsphp svn 函数 creates and returns a stream that will be used to replacephp mongocursor advances the cursor to the next result and returns that resultphp mongodb bson minkey returns a representation that can be converted to jsonphp solrquery returns the value for the facet.date.other parameterphp solrquery returns the maximum number of query terms that will be included in any generated queryphp solrquery returns all the stats facets that were setphp solrquery returns whether or not to include the lower bound in the result set
关注编程学问公众号