Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4fccfe23f6486142b4197d1daac0cf21 > files > 117

Falcon-doc-0.9.6.6-2.fc15.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Class SyncQueue - Class SyncQueue</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./modules.html"><span>Modules</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./enum.html"><span>Enumerations</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Class SyncQueue<span class="faldoc_belong"><a href="./module_feathers_threading.html">[in Threading]</a></p></h1>

<p class="faldoc_brief">Signaler of relevant processing conditions. </p>
<p class="faldoc_funcdecl">
<b>class</b> SyncQueue \
      <b>from</b> <a href="./class_Waitable.html">Waitable</a>
</p>


   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#empty">empty()</a></td><td>Returns true if the queue is empty. </td></tr>
      
         <tr><td><a href="#pop">pop()</a></td><td>Pops an item from the back of the queue. </td></tr>
      
         <tr><td><a href="#popFront">popFront()</a></td><td>Pops an item from the front of the queue. </td></tr>
      
         <tr><td><a href="#push">push()</a></td><td>Pushes an item at the end of the queue. </td></tr>
      
         <tr><td><a href="#pushFront">pushFront()</a></td><td>Pushes an item in front of the queue. </td></tr>
      
         <tr><td><a href="#size">size()</a></td><td>Returns the count of elements currently stored in the queue. </td></tr>
      
   
   </table>





   <h3 class="faldoc_title">Inherited methods</h3>
   <table class="faldoc_list">
   
      <tr><td><a href="./class_Waitable.html#release">release</a> from Waitable&nbsp;</td><td>Releases a structure acquired by a waiting function. </td></tr>
   
   </table>



<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>

<p class="faldoc_funcdecl">
<b>class</b> SyncQueue \
      <b>from</b> <a href="./class_Waitable.html">Waitable</a>
</p>
<table class="faldoc_function">


</table>
<br/>
<p class="item_brief">Signaler of relevant processing conditions. </p>
<p class="faldoc_text">This class implements a synchronized Falcon items FIFO or LIFO queue that can be waited on for non-empty status. </p>
<p class="faldoc_text">A single waiting thread will acquire the queue when it is not empty; at that point, it can dequeue one or more items being previously pushed, released the queue and processed the dequeued items. </p>
<p class="faldoc_text">Holding the queue in acquired status prevents concurrent insertion of new items, as well as removal, so it's advisable to release the queue as soon as possible, that is, as soon as the items that must be processed are retrieved. </p>
<p class="faldoc_note"><span class="faldoc_notetype">Note:</span> Always remember that items in the queue are serialized copies coming from the pushing VMs. Serialization is a relatively expensive operation for non-simple types, and may cause error raising if the pushed items are not serializable. </p>




   <h2 class="faldoc_title">Methods</h2>
   
      <h3 class="faldoc_funcname"><a name="empty">empty()</a></h3>
      <p class="item_brief">Returns true if the queue is empty. </p>
      <p class="faldoc_funcdecl">SyncQueue.empty( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">True if the queue is empty. </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">Although it is possible to call this method in any moment, it is consistent to call it only when the queue has been acquired through a succesful wait. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="pop">pop()</a></h3>
      <p class="item_brief">Pops an item from the back of the queue. </p>
      <p class="faldoc_funcdecl">SyncQueue.pop( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">The item that was at the end of the queue. </td></tr>
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_ThreadError.html">ThreadError</a></td><td class="faldoc_raisedesc">if the queue is empty. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method removes an item from the end of the queue and returns it to the caller. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="popFront">popFront()</a></h3>
      <p class="item_brief">Pops an item from the front of the queue. </p>
      <p class="faldoc_funcdecl">SyncQueue.popFront( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">The item that was in front of the queue. </td></tr>
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_ThreadError.html">ThreadError</a></td><td class="faldoc_raisedesc">if the queue is empty. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method removes an item in front of the queue and returns it to the caller. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="push">push()</a></h3>
      <p class="item_brief">Pushes an item at the end of the queue. </p>
      <p class="faldoc_funcdecl">SyncQueue.push( item )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">item</td><td class="faldoc_paramdesc">The item to be pushed </td></tr>
         
         
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><b><i>CodeError</i></b></td><td class="faldoc_raisedesc"> if the <b>item</b> is not serializable. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method adds an item at the end of the queue. If the queue was empty, waiting threads may be signaled to receive the added item. </p>
<p class="faldoc_text"> The <b>item</b> parameter must be a serializable item, or a CodeError will be raised. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="pushFront">pushFront()</a></h3>
      <p class="item_brief">Pushes an item in front of the queue. </p>
      <p class="faldoc_funcdecl">SyncQueue.pushFront( item )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">item</td><td class="faldoc_paramdesc">The item to be pushed </td></tr>
         
         
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><b><i>CodeError</i></b></td><td class="faldoc_raisedesc"> if the <b>item</b> is not serializable. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method adds an item in front of the queue. If the queue was empty, waiting threads may be signaled to receive the added item. </p>
<p class="faldoc_text"> The <b>item</b> parameter must be a serializable item, or a CodeError will be raised. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="size">size()</a></h3>
      <p class="item_brief">Returns the count of elements currently stored in the queue. </p>
      <p class="faldoc_funcdecl">SyncQueue.size( )</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">Number of elements currently held in the queue. </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">Although it is possible to call this method in any moment, it is consistent to call it only when the queue has been acquired through a succesful wait. </p>
</p>
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./modules.html">Modules</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./enum.html">Enumerations</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>