<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<phpdoc:classref xml:id="class.worker" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

 <title>The Worker class</title>
 <titleabbrev>Worker</titleabbrev>

 <partintro>

<!-- {{{ Worker intro -->
  <section xml:id="worker.intro">
   &reftitle.intro;
   <para>
   Worker Threads have a persistent context, as such should be used over Threads in most cases.
   </para>
   <para>
   When a Worker is started, the run method will be executed, but the Thread will not leave until one of the following conditions are met:
   </para>
   <itemizedlist>
    <listitem>
    <para>the Worker goes out of scope (no more references remain)</para>
    </listitem>
    <listitem>
    <para>the programmer calls shutdown</para>
    </listitem>
    <listitem>
    <para>the script dies</para>
    </listitem>
   </itemizedlist>
   <para>
   This means the programmer can reuse the context throughout execution; placing objects on the stack of the Worker will cause the Worker to
   execute the stacked objects run method.
   </para>
  </section>
<!-- }}} -->

  <section xml:id="worker.synopsis">
   &reftitle.classsynopsis;

<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>Worker</classname></ooclass>

<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <ooclass>
      <classname>Worker</classname>
     </ooclass>
     
     <ooclass>
      <modifier>extends</modifier>
      <classname>Thread</classname>
     </ooclass>
     
     <oointerface>
      <interfacename>Traversable</interfacename>
     </oointerface>

     <oointerface>
      <interfacename>Countable</interfacename>
     </oointerface>
     
     <oointerface>
      <interfacename>ArrayAccess</interfacename>
     </oointerface>
    </classsynopsisinfo>
<!-- }}} -->
    
    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.worker')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />
    
    <classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.thread')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />

   </classsynopsis>
<!-- }}} -->

  </section>

 </partintro>

 &reference.pthreads.entities.worker;

</phpdoc:classref>

<!-- 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
-->
