uTools-Manuals/docs/php/com_message_pump.html
2019-04-08 23:22:26 +08:00

73 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>Process COM messages, sleeping for up to timeoutms milliseconds</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.com-message-pump" class="refentry">
<div class="refnamediv">
<h1 class="refname">com_message_pump</h1>
<p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">com_message_pump</span> &mdash; <span class="dc-title">Process COM messages, sleeping for up to timeoutms milliseconds</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.com-message-pump-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>com_message_pump</strong></span>
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeoutms</code><span class="initializer"> = 0</span></span>
] ) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
This function will sleep for up to <code class="parameter">timeoutms</code>
milliseconds, or until a message arrives in the queue.
</p>
<p class="para">
The purpose of this function is to route COM calls between apartments and
handle various synchronization issues. This allows your script to wait
efficiently for events to be triggered, while still handling other events
or running other code in the background. You should use it in a loop, as
demonstrated by the example in the <span class="function"><a href="com_event_sink.html" class="function">com_event_sink()</a></span>
function, until you are finished using event bound COM objects.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.com-message-pump-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">timeoutms</code></dt>
<dd>
<p class="para">
The timeout, in milliseconds.
</p>
<p class="para">
If you do not specify a value for <code class="parameter">timeoutms</code>,
then 0 will be assumed. A 0 value means that no waiting will be
performed; if there are messages pending they will be dispatched as
before; if there are no messages pending, the function will return
<strong><code>FALSE</code></strong> immediately without sleeping.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.com-message-pump-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
If a message or messages arrives before the timeout, they will be
dispatched, and the function will return <strong><code>TRUE</code></strong>. If the timeout occurs and
no messages were processed, the return value will be <strong><code>FALSE</code></strong>.
</p>
</div>
</div></div></div></body></html>