uTools-Manuals/docs/php/event_add.html
2019-04-28 19:00:34 +08:00

79 lines
3.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Add an event to the set of monitored events</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.event-add" class="refentry">
<div class="refnamediv">
<h1 class="refname">event_add</h1>
<p class="verinfo">(PECL libevent &gt;= 0.0.1)</p><p class="refpurpose"><span class="refname">event_add</span> &mdash; <span class="dc-title">Add an event to the set of monitored events</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.event-add-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><a href="event.add.html" class="methodname">event_add</a></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$event</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code><span class="initializer"> = -1</span></span>
] ) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
<span class="function"><a href="event.add.html" class="function">event_add()</a></span> schedules the execution of the <code class="parameter">event</code>
when the event specified in <span class="function"><a href="event.set.html" class="function">event_set()</a></span> occurs or in at least the time
specified by the <code class="parameter">timeout</code> argument. If
<code class="parameter">timeout</code> was not specified, not timeout is set. The
<code class="parameter">event</code> must be already initalized by <span class="function"><a href="event.set.html" class="function">event_set()</a></span>
and <span class="function"><a href="event_base_set.html" class="function">event_base_set()</a></span> functions. If the
<code class="parameter">event</code> already has a timeout set, it is replaced by
the new one.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.event-add-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">event</code></dt>
<dd>
<p class="para">
Valid event resource.
</p>
</dd>
<dt>
<code class="parameter">timeout</code></dt>
<dd>
<p class="para">
Optional timeout (in microseconds).
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.event-add-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
<span class="function"><a href="event.add.html" class="function">event_add()</a></span> returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on error.
</p>
</div>
</div></div></div></body></html>