Source

python-cloudfiles / docs / cloudfiles.connection.ConnectionPool-class.html

Full commit
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>cloudfiles.connection.ConnectionPool</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="cloudfiles-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.rackspacecloud.com/">Cloud Files Python API</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="cloudfiles-module.html">Package&nbsp;cloudfiles</a> ::
        <a href="cloudfiles.connection-module.html">Module&nbsp;connection</a> ::
        Class&nbsp;ConnectionPool
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="cloudfiles.connection.ConnectionPool-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ConnectionPool</h1><p class="nomargin-top"><span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_cloudfil_2" name="uml_class_diagram_for_cloudfil_2">
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#__init__" title="cloudfiles.connection.ConnectionPool.__init__" alt="" coords="17,228,355,247"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#get" title="Return a cloudfiles connection object." alt="" coords="17,247,355,265"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#put" title="Place a cloudfiles connection object back into the pool." alt="" coords="17,265,355,284"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html" title="A thread&#45;safe connection pool object." alt="" coords="5,195,365,290"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Indicate that a formerly enqueued task is complete." alt="" coords="120,39,252,57"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Blocks until all items in the Queue have been gotten and processed." alt="" coords="120,57,252,76"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return the approximate size of the queue (not reliable!)." alt="" coords="120,76,252,95"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return True if the queue is empty, False otherwise (not reliable!)." alt="" coords="120,95,252,113"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return True if the queue is full, False otherwise (not reliable!)." alt="" coords="120,113,252,132"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Put an item into the queue without blocking." alt="" coords="120,132,252,151"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Remove and return an item from the queue without blocking." alt="" coords="120,151,252,169"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Create a queue object with a given maximum size." alt="" coords="108,6,263,175"/>
</map>
  <img src="uml_class_diagram_for_cloudfil_2.gif" alt='' usemap="#uml_class_diagram_for_cloudfil_2" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>A thread-safe connection pool object.</p>
  <p>This component isn't required when using the cloudfiles library, but 
  it may be useful when building threaded applications.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="cloudfiles.connection.ConnectionPool-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">username</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">api_key</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="cloudfiles.connection.Connection-class.html" 
      class="link">Connection</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="cloudfiles.connection.ConnectionPool-class.html#get" class="summary-sig-name">get</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Return a cloudfiles connection object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.get">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="cloudfiles.connection.ConnectionPool-class.html#put" class="summary-sig-name">put</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">connobj</span>)</span><br />
      Place a cloudfiles connection object back into the pool.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.put">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>Queue.Queue</code></b>:
      <code>empty</code>,
      <code>full</code>,
      <code>get_nowait</code>,
      <code>join</code>,
      <code>put_nowait</code>,
      <code>qsize</code>,
      <code>task_done</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">username</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">api_key</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">**kwargs</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        Queue.Queue.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="get"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.get">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Return a cloudfiles connection object.</p>
  <dl class="fields">
    <dt>Returns: <a href="cloudfiles.connection.Connection-class.html" 
      class="link">Connection</a></dt>
        <dd>a cloudfiles connection object</dd>
    <dt>Overrides:
        Queue.Queue.get
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="put"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">put</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">connobj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool.put">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Place a cloudfiles connection object back into the pool.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>connobj</code></strong> (<a href="cloudfiles.connection.Connection-class.html" 
          class="link">Connection</a>) - a cloudfiles connection object</li>
    </ul></dd>
    <dt>Overrides:
        Queue.Queue.put
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="cloudfiles-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.rackspacecloud.com/">Cloud Files Python API</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri Jun  1 13:14:13 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>