<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="ev.supportedbackends" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Ev::supportedBackends</refname>
  <refpurpose>Returns the set of backends supported by current libev
  configuration</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>final</modifier>
   <modifier>public</modifier>
   <modifier>static</modifier>
   <type>int</type>
   <methodname>Ev::supportedBackends</methodname>
   <void />
  </methodsynopsis>
  <para>
   Returns the set of backends supported by current libev configuration.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns a bit mask which can containing
   <link
  linkend="ev.constants.watcher-backends">backend flags</link>
   combined using bitwise
   <emphasis>OR</emphasis>
   operator.
  </para>
 </refsect1>
 <refsect1 role="examples">
  &reftitle.examples;
 <example>
   <title>Embedding loop created with kqueue backend into the default loop</title>
   <programlisting role="php">
<![CDATA[
<?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
?>
]]>
   </programlisting>
  </example>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member>
    <classname>EvEmbed</classname>
   </member>
   <member>
    <methodname>Ev::recommendedBackends</methodname>
   </member>
   <member>
    <methodname>Ev::embeddableBackends</methodname>
   </member>
   <member>
    <link linkend="ev.constants.watcher-backends">Backend flags</link>
   </member>
   <member>
    <link linkend="ev.examples">Examples</link>
   </member>
  </simplelist>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
