-
Notifications
You must be signed in to change notification settings - Fork 788
/
Copy pathevloop.xml
257 lines (254 loc) · 7.74 KB
/
evloop.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<reference xml:id="class.evloop" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The EvLoop class</title>
<titleabbrev>EvLoop</titleabbrev>
<partintro>
<!-- {{{ EvLoop intro -->
<section xml:id="evloop.intro">
&reftitle.intro;
<para>
Represents an event loop that is always distinct from the
<emphasis>default
loop</emphasis>.
Unlike the
<emphasis>default loop</emphasis>,
it cannot handle
<classname>EvChild</classname>
watchers.
</para>
<para>
Having threads we have to create a loop per thread, and use the
<emphasis>default loop</emphasis>
in the parent thread.
</para>
<para>
The
<emphasis>default event loop</emphasis>
is initialized automatically by
<emphasis>Ev</emphasis>.
It is accessible via methods of the
<classname>Ev</classname>
class, or via
<methodname>EvLoop::defaultLoop</methodname>
method.
</para>
</section>
<!-- }}} -->
<section xml:id="evloop.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass>
<classname>EvLoop</classname>
</ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>final</modifier>
<classname>EvLoop</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.data">data</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.backend">backend</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.is-default-loop">is_default_loop</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.iteration">iteration</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.pending">pending</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.io-interval">io_interval</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.timeout-interval">timeout_interval</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<varname linkend="evloop.props.depth">depth</varname>
</fieldsynopsis>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.evloop')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])"/>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.evloop')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])"/>
</classsynopsis>
<!-- }}} -->
</section>
<!-- {{{ EvLoop properties -->
<section xml:id="evloop.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="evloop.props.data">
<term>
<varname>data</varname>
</term>
<listitem>
<para>
Custom data attached to loop
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.backend">
<term>
<varname>backend</varname>
</term>
<listitem>
<para>
<emphasis>Readonly</emphasis>.
The
<link linkend="ev.constants.watcher-backends">backend flags</link>
indicating the event backend in use.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.is-default-loop">
<term>
<varname>is_default_loop</varname>
</term>
<listitem>
<para>
<emphasis>Readonly</emphasis>.
&true; if it is the default event loop.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.iteration">
<term>
<varname>iteration</varname>
</term>
<listitem>
<para>
The current iteration count of the loop. See
<methodname>Ev::iteration</methodname>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.pending">
<term>
<varname>pending</varname>
</term>
<listitem>
<para>
The number of pending watchers.
<literal>0</literal>
indicates that there are no watchers pending.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.io-interval">
<term>
<varname>io_interval</varname>
</term>
<listitem>
<para>
Higher
<varname>io_interval</varname>
allows
<emphasis>libev</emphasis>
to spend more time collecting
<classname>EvIo</classname>
events, so more events can be handled per iteration, at the cost of
increasing latency. Timeouts (both
<classname>EvPeriodic</classname>
and
<classname>EvTimer</classname>)
will not be affected. Setting this to a non-zero value will introduce
an additional
<literal>sleep()</literal>
call into most loop iterations. The sleep time ensures that
<emphasis>libev</emphasis>
will not poll for
<classname>EvIo</classname>
events more often than once per this interval, on average. Many
programs can usually benefit by setting the
<varname>io_interval</varname>
to a value near
<literal>0.1</literal>,
which is often enough for interactive servers(not for games). It
usually doesn't make much sense to set it to a lower value than
<literal>0.01</literal>,
as this approaches the timing granularity of most systems.
</para>
<para>
See also
<link
xlink:href="http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#FUNCTIONS_CONTROLLING_EVENT_LOOPS">FUNCTIONS
CONTROLLING EVENT LOOPS</link>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.timeout-interval">
<term>
<varname>timeout_interval</varname>
</term>
<listitem>
<para>
Higher
<varname>timeout_interval</varname>
allows
<emphasis>libev</emphasis>
to spend more time collecting timeouts, at the expense of increased
latency/jitter/inexactness(the watcher callback will be called later).
<classname>EvIo</classname>
watchers will not be affected. Setting this to a non-null value will
not introduce any overhead in
<emphasis>libev</emphasis>.
See also
<link
xlink:href="http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#FUNCTIONS_CONTROLLING_EVENT_LOOPS">FUNCTIONS
CONTROLLING EVENT LOOPS</link>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="evloop.props.depth">
<term>
<varname>depth</varname>
</term>
<listitem>
<para>
The recursion depth. See
<methodname>Ev::depth</methodname>.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<!-- }}} -->
</partintro>
&reference.ev.entities.evloop;
</reference>
<!-- 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
-->