<!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>The SyncEvent class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="syncsemaphore.unlock.html">SyncSemaphore::unlock</a></div> <div class="next" style="text-align: right; float: right;"><a href="syncevent.construct.html">SyncEvent::__construct</a></div> <div class="up"><a href="book.sync.html">Sync</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.syncevent" class="reference"> <h1 class="title">The SyncEvent class</h1> <div class="partintro"><p class="verinfo">(PECL sync >= 1.0.0)</p> <div class="section" id="syncevent.intro"> <h2 class="title">Introduction</h2> <p class="para"> A cross-platform, native implementation of named and unnamed event objects. Both automatic and manual event objects are supported. </p> <p class="para"> An event object waits, without polling, for the object to be fired/set. One instance waits on the event object while another instance fires/sets the event. Event objects are useful wherever a long-running process would otherwise poll a resource (e.g. checking to see if uploaded data needs to be processed). </p> </div> <div class="section" id="syncevent.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <strong class="classname">SyncEvent</strong> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><a href="syncevent.construct.html" class="methodname">__construct</a></span> ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span> [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$manual</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span> [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$prefire</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span> ]]] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="syncevent.fire.html" class="methodname">fire</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="syncevent.reset.html" class="methodname">reset</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="syncevent.wait.html" class="methodname">wait</a></span> ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$wait</code><span class="initializer"> = -1</span></span> ] )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="syncevent.construct.html">SyncEvent::__construct</a> — Constructs a new SyncEvent object</li><li><a href="syncevent.fire.html">SyncEvent::fire</a> — Fires/sets the event</li><li><a href="syncevent.reset.html">SyncEvent::reset</a> — Resets a manual event</li><li><a href="syncevent.wait.html">SyncEvent::wait</a> — Waits for the event to be fired/set</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="syncsemaphore.unlock.html">SyncSemaphore::unlock</a></div> <div class="next" style="text-align: right; float: right;"><a href="syncevent.construct.html">SyncEvent::__construct</a></div> <div class="up"><a href="book.sync.html">Sync</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>