-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61de543
commit dcd4d5d
Showing
49 changed files
with
4,471 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: 33e5f4ef7243bc1282acb1cba93e8f99c1debe68 Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara --> | ||
<refentry xml:id="evembed.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>EvEmbed::__construct</refname> | ||
<refpurpose>Constrói o objeto EvEmbed</refpurpose> | ||
</refnamediv> | ||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<constructorsynopsis> | ||
<modifier>public</modifier> | ||
<methodname>EvEmbed::__construct</methodname> | ||
<methodparam> | ||
<type>object</type> | ||
<parameter>other</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>callable</type> | ||
<parameter>callback</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>mixed</type> | ||
<parameter>data</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>int</type> | ||
<parameter>priority</parameter> | ||
</methodparam> | ||
</constructorsynopsis> | ||
<para> | ||
Este é um tipo de observador bastante avançado que permite incorporar um laço | ||
de eventos em outro (atualmente, apenas eventos de E/S são suportados no laço incorporado; | ||
outros tipos de observadores podem ser manipulados de forma atrasada ou incorreta | ||
e não devem ser usados). | ||
</para> | ||
<para> | ||
Consulte | ||
<link | ||
xlink:href="http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_embed_code_when_one_backend_">a | ||
documentção da libev</link> | ||
para detalhes. | ||
</para> | ||
<para> | ||
Este observador é mais útil em | ||
sistemas <emphasis>BSD</emphasis> | ||
sem | ||
<literal>kqueue</literal> funcional | ||
para que ainda seja possível manipular um número grande de soquetes. Veja o exemplo abaixo. | ||
</para> | ||
</refsect1> | ||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term> | ||
<parameter>other</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
Instância de | ||
<classname>EvLoop</classname>. | ||
O laço a ser incorporado, este laço precisa ser incorporável | ||
(consulte | ||
<methodname>Ev::embeddableBackends</methodname>). | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>callback</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
Consulte | ||
<link linkend="ev.watcher-callbacks">funções de retorno | ||
observadoras</link>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>data</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
Dados personalizados associados com o observador. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>priority</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
<link linkend="ev.constants.watcher-pri">Prioridade de observadores</link>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example> | ||
<title>Incorporando laço criado com o backend kqueue no laço padrão</title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
/* | ||
* Verifica se o kqueue está disponível, mas não é recomendado, e cria um backend kqueue | ||
* para uso com sockets (que geralmente funcionam com qualquer implementação kqueue). | ||
* Armazena o laço de eventos kqueue/somente-socket em loop_socket. (Opcionalmente, | ||
* pode-se usar EVFLAG_NOENV também) | ||
* | ||
* Exemplo emprestado de | ||
* 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; | ||
} | ||
// Agora usa $socket_loop para todos os sockets e $loop para qualquer outra coisa | ||
?> | ||
]]> | ||
</programlisting> | ||
</example> | ||
</refsect1> | ||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member> | ||
<methodname>Ev::embeddableBackends</methodname> | ||
</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 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: 8d666e819852f6b0561b40fcf8689b747568865c Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara --> | ||
<refentry xml:id="evembed.createstopped" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>EvEmbed::createStopped</refname> | ||
<refpurpose>Cria objeto observador EvEmbed parado</refpurpose> | ||
</refnamediv> | ||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<modifier>final</modifier> | ||
<modifier>public</modifier> | ||
<modifier>static</modifier> | ||
<type>void</type> | ||
<methodname>EvEmbed::createStopped</methodname> | ||
<methodparam> | ||
<type>object</type> | ||
<parameter>other</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>callable</type> | ||
<parameter>callback</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>mixed</type> | ||
<parameter>data</parameter> | ||
</methodparam> | ||
<methodparam choice="opt"> | ||
<type>int</type> | ||
<parameter>priority</parameter> | ||
</methodparam> | ||
</methodsynopsis> | ||
<para> | ||
O mesmo que | ||
<methodname>EvEmbed::__construct</methodname> | ||
mas não inicia o observador automaticamente. | ||
</para> | ||
</refsect1> | ||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term> | ||
<parameter>other</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
O mesmo que para | ||
<methodname>EvEmbed::__construct</methodname>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>callback</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
Consulte | ||
<link linkend="ev.watcher-callbacks">funções de retorno | ||
observadoras</link>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>data</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
Dados personalizados associados com o observador. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term> | ||
<parameter>priority</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
<link linkend="ev.constants.watcher-pri">Prioridade de observadores</link>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
Retorna o objeto EvEmbed parado em caso de sucesso. | ||
</para> | ||
</refsect1> | ||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member> | ||
<methodname>EvEmbed::__construct</methodname> | ||
</member> | ||
<member> | ||
<methodname>Ev::embeddableBackends</methodname> | ||
</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 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: 8d666e819852f6b0561b40fcf8689b747568865c Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara --> | ||
<refentry xml:id="evembed.set" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>EvEmbed::set</refname> | ||
<refpurpose>Configura o observador</refpurpose> | ||
</refnamediv> | ||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<modifier>public</modifier> | ||
<type>void</type> | ||
<methodname>EvEmbed::set</methodname> | ||
<methodparam> | ||
<type>object</type> | ||
<parameter>other</parameter> | ||
</methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Configura o observador para usar | ||
o objeto de laço de eventos | ||
<parameter>other</parameter>. | ||
</para> | ||
</refsect1> | ||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term> | ||
<parameter>other</parameter> | ||
</term> | ||
<listitem> | ||
<para> | ||
O mesmo que para | ||
<methodname>EvEmbed::__construct</methodname>. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
&return.void; | ||
</para> | ||
</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 | ||
--> |
Oops, something went wrong.