function.com-message-pump.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 87 行
HTML
87 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Process COM messages, sleeping for up to timeoutms milliseconds</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.com-load.html">com_load</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.com-print-typeinfo.html">com_print_typeinfo</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.com-message-pump" class="refentry"> <div class="refnamediv"> <h1 class="refname">com_message_pump</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">com_message_pump</span> — <span class="dc-title">Process COM messages, sleeping for up to timeoutms milliseconds</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>com_message_pump</b></b></span> ([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$timeoutms</tt></span> ] )</div> <p class="para rdfs-comment"> This function will sleep for up to <i><tt class="parameter">timeoutms</tt></i> 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 <a href="function.com-event-sink.html" class="function">com_event_sink()</a> function, until you are finished using event bound COM objects. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">timeoutms</tt></i></span> <dd> <p class="para"> The timeout, in milliseconds. </p> <p class="para"> If you do not specify a value for <i><tt class="parameter">timeoutms</tt></i>, 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 <b><tt>FALSE</tt></b> immediately without sleeping. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> If a message or messages arrives before the timeout, they will be dispatched, and the function will return <b><tt>TRUE</tt></b>. If the timeout occurs and no messages were processed, the return value will be <b><tt>FALSE</tt></b>. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.com-load.html">com_load</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.com-print-typeinfo.html">com_print_typeinfo</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?