Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated docco docs

  • Loading branch information...
commit e9ee8cf1a7b92bfabaed03cd58f2e77d09cb1f36 1 parent a882eb5
Pascal Opitz authored
Showing with 60 additions and 42 deletions.
  1. +60 −42 docs/beanstalk_client.html
View
102 docs/beanstalk_client.html
@@ -1,6 +1,6 @@
<!DOCTYPE html> <html> <head> <title>beanstalk_client.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> beanstalk_client.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Includes</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">events</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;events&#39;</span><span class="p">),</span>
<span class="nx">net</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;net&#39;</span><span class="p">),</span>
- <span class="nx">sys</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;sys&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h2>yaml wrapper</h2>
+ <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h2>yaml wrapper</h2>
<p>because yaml doesn't like beanstalk</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">yaml</span> <span class="o">=</span> <span class="k">new</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nb">eval</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
@@ -10,7 +10,7 @@
<span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/(\w)\-(\w)/mgi</span><span class="p">,</span> <span class="s1">&#39;$1_$2&#39;</span><span class="p">)</span> <span class="c1">// replace minuses in hash names</span>
<span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\n([\w\d_-]+)\:\ ([\.\,\w\d_-]+)/mig</span><span class="p">,</span> <span class="s1">&#39;\n $1: \&#39;$2\&#39;&#39;</span><span class="p">)</span> <span class="c1">// format hashes</span>
<span class="p">;</span>
-
+
<span class="k">try</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;yaml&#39;</span><span class="p">).</span><span class="nb">eval</span><span class="p">(</span><span class="nx">corrected</span><span class="p">);</span>
<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
@@ -45,7 +45,7 @@
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Internal command object</h2> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">BeanstalkCommand</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
<span class="p">};</span>
-<span class="nx">sys</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">BeanstalkCommand</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">BeanstalkCommand</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span>
<span class="nx">BeanstalkCommand</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onSuccess</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">callback</span><span class="p">)</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="s1">&#39;command_done&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
@@ -93,8 +93,11 @@
<span class="k">this</span><span class="p">.</span><span class="nx">port</span> <span class="o">=</span> <span class="mi">11300</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">default_priority</span> <span class="o">=</span> <span class="mi">10</span><span class="p">;</span>
+
+ <span class="k">this</span><span class="p">.</span><span class="nx">queue</span> <span class="o">=</span> <span class="p">[];</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">waitingForResponses</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">};</span>
-<span class="nx">sys</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">BeanstalkClient</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Singleton like method that returns an instance</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">Instance</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">server</span><span class="p">)</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">BeanstalkClient</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Singleton like method that returns an instance</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">Instance</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">server</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="p">[];</span>
<span class="k">if</span><span class="p">(</span><span class="nx">server</span><span class="p">)</span> <span class="p">{</span>
@@ -105,22 +108,36 @@
<span class="k">this</span><span class="p">.</span><span class="nx">port</span> <span class="o">=</span> <span class="p">(</span><span class="nx">p</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="o">?</span> <span class="nx">p</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">port</span><span class="p">;</span>
<span class="k">return</span> <span class="k">this</span><span class="p">;</span>
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>executes command</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">command</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">_self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
- <span class="kd">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">BeanstalkCommand</span><span class="p">();</span>
- <span class="nx">cmd</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="nx">cmd</span><span class="p">.</span><span class="nx">responseHandler</span><span class="p">);</span>
- </pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>handles data that comes back from the connection</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">dataHandler</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">_self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">cmd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">BeanstalkCommand</span><span class="p">();</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>makes sure that if there's another command queued, it gets done</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">cmd</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="s1">&#39;command_done&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span><span class="p">(</span><span class="nx">_self</span><span class="p">.</span><span class="nx">queue</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">next</span> <span class="o">=</span> <span class="nx">_self</span><span class="p">.</span><span class="nx">queue</span><span class="p">.</span><span class="nx">shift</span><span class="p">();</span>
+ <span class="nx">process</span><span class="p">.</span><span class="nx">nextTick</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">_self</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">next</span><span class="p">);</span>
+ <span class="p">});</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="nx">_self</span><span class="p">.</span><span class="nx">waitingForResponse</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">});</span>
+
+ </pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>handles data that comes back from the connection</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">dataHandler</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;response:&#39;</span><span class="p">);</span>
<span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
- <span class="nx">cmd</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="nx">data</span><span class="p">,</span> <span class="nx">obj</span><span class="p">);</span>
- <span class="p">};</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>pushes commands to the server</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">requestExec</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;request:&#39;</span><span class="p">);</span>
- <span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
- <span class="nx">process</span><span class="p">.</span><span class="nx">nextTick</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
- <span class="nx">_self</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
- <span class="p">});</span>
+ <span class="nx">cmd</span><span class="p">.</span><span class="nx">responseHandler</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">cmd</span><span class="p">,</span> <span class="nx">data</span><span class="p">,</span> <span class="nx">obj</span><span class="p">);</span>
+ <span class="p">};</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>pushes commands to the server</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">requestExec</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">_self</span><span class="p">.</span><span class="nx">waitingForResponse</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">_self</span><span class="p">.</span><span class="nx">waitingForResponse</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
+ <span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;request:&#39;</span><span class="p">);</span>
+ <span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
+ <span class="nx">process</span><span class="p">.</span><span class="nx">nextTick</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">_self</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
+ <span class="p">});</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="nx">_self</span><span class="p">.</span><span class="nx">queue</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">data</span><span class="p">);</span>
+ <span class="p">}</span>
<span class="p">};</span>
- <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>if there's no connection, create one</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">this</span><span class="p">.</span><span class="nx">conn</span> <span class="o">=</span> <span class="nx">net</span><span class="p">.</span><span class="nx">createConnection</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">port</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">address</span><span class="p">);</span>
+ <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">)</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>if there's no connection, create one</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">this</span><span class="p">.</span><span class="nx">conn</span> <span class="o">=</span> <span class="nx">net</span><span class="p">.</span><span class="nx">createConnection</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">port</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">address</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">setNoDelay</span><span class="p">();</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">setKeepAlive</span><span class="p">();</span>
@@ -144,37 +161,38 @@
<span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;connection closed&#39;</span><span class="p">);</span>
<span class="p">});</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">removeAllListeners</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">);</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">removeAllListeners</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">);</span>
<span class="nx">requestExec</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">command</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="nx">dataHandler</span><span class="p">);</span>
<span class="k">return</span> <span class="nx">cmd</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>disconnects a client</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">disconnect</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>disconnects a client</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">disconnect</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">end</span><span class="p">();</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">conn</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
<span class="k">this</span><span class="p">.</span><span class="nx">conn</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <h2>Beanstalk client commands</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <h3>use</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <h2>Beanstalk client commands</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <h3>use</h3>
<p>uses tube, this is for producers</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">use</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tube</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;use &#39;</span><span class="o">+</span><span class="nx">tube</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;USING&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <h3>watch</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <h3>watch</h3>
<p>watches tube, this is for receivers</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">watch</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tube</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;watch &#39;</span><span class="o">+</span><span class="nx">tube</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;WATCHING&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <h3>ignore</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <h3>ignore</h3>
<p>ignores tube</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">ignore</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tube</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;ignore &#39;</span><span class="o">+</span><span class="nx">tube</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;WATCHING&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <h3>put</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <h3>put</h3>
<p>puts data in a tube</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">put</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span> <span class="nx">priority</span><span class="p">,</span> <span class="nx">delay</span><span class="p">,</span> <span class="nx">ttr</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span><span class="p">(</span><span class="k">typeof</span> <span class="nx">priority</span> <span class="o">==</span> <span class="s1">&#39;undefined&#39;</span><span class="p">)</span> <span class="p">{</span>
@@ -193,35 +211,35 @@
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;put &#39;</span><span class="o">+</span><span class="nx">priority</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">delay</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">ttr</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">data</span><span class="p">.</span><span class="nx">toString</span><span class="p">().</span><span class="nx">length</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="o">+</span><span class="nx">data</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;INSERTED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <h3>reserve</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <h3>reserve</h3>
<p>picks up job from tube</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">reserve</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;reserve\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;RESERVED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <h3>reserve</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <h3>reserve</h3>
<p>picks up job from tube, with timeout</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">reserve_with_timeout</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">time</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;reserve-with-timeout &#39;</span><span class="o">+</span><span class="nx">time</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;RESERVED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <h3>touch</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <h3>touch</h3>
<p>tell the server that you're still working on a job</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">touch</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;touch &#39;</span><span class="o">+</span><span class="nx">id</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;TOUCHED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <h3>delete</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <h3>delete</h3>
<p>delets job from queue</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">deleteJob</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;delete &#39;</span><span class="o">+</span><span class="nx">id</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;DELETED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <h3>release</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <h3>release</h3>
<p>releases job from reserved state</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">release</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">,</span> <span class="nx">priority</span><span class="p">,</span> <span class="nx">delay</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span><span class="p">(</span><span class="k">typeof</span> <span class="nx">priority</span> <span class="o">==</span> <span class="s1">&#39;undefined&#39;</span><span class="p">)</span> <span class="p">{</span>
@@ -236,7 +254,7 @@
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;release &#39;</span><span class="o">+</span><span class="nx">id</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">priority</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">delay</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;RELEASED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <h3>bury</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <h3>bury</h3>
<p>buries job so it isn't picked up by reserve</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">bury</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">,</span> <span class="nx">priority</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span><span class="p">(</span><span class="k">typeof</span> <span class="nx">priority</span> <span class="o">==</span> <span class="s1">&#39;undefined&#39;</span><span class="p">)</span> <span class="p">{</span>
@@ -247,42 +265,42 @@
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;bury &#39;</span><span class="o">+</span><span class="nx">id</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">priority</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;BURIED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <h3>kick</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <h3>kick</h3>
<p>kicks buried job back into queue</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">kick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">bound</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;kick &#39;</span><span class="o">+</span><span class="nx">bound</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;KICKED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <h3>peek</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> <h3>peek</h3>
<p>let's you inspect a job</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">peek</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;peek &#39;</span><span class="o">+</span><span class="nx">id</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;FOUND&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> <h3>peek-ready</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <h3>peek-ready</h3>
<p>let's you inspect the next ready job</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">peek_ready</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;peek-ready\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;FOUND&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <h3>peek-delayed</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <h3>peek-delayed</h3>
<p>let's you inspect the next delayed job</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">peek_delayed</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;peek-delayed\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;FOUND&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <h3>peek-buried</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <h3>peek-buried</h3>
<p>let's you inspect the next buried job</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">peek_buried</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;peek-buried\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;FOUND&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <h3>stats</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">&#182;</a> </div> <h3>stats</h3>
<p>gives statistical information about the server</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">stats</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
@@ -290,7 +308,7 @@
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;OK&#39;</span><span class="p">,</span>
<span class="nx">is_yaml</span><span class="o">:</span> <span class="mi">1</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">&#182;</a> </div> <h3>stats-job</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-33"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-33">&#182;</a> </div> <h3>stats-job</h3>
<p>gives statistical information about the specified job if it exists</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">stats_job</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
@@ -298,7 +316,7 @@
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;OK&#39;</span><span class="p">,</span>
<span class="nx">is_yaml</span><span class="o">:</span> <span class="mi">1</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-33"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-33">&#182;</a> </div> <h3>stats-tube</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-34"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-34">&#182;</a> </div> <h3>stats-tube</h3>
<p>gives statistical information about the specified tube if it exists</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">stats_tube</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tube</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
@@ -306,7 +324,7 @@
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;OK&#39;</span><span class="p">,</span>
<span class="nx">is_yaml</span><span class="o">:</span> <span class="mi">1</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-34"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-34">&#182;</a> </div> <h3>list-tubes</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-35"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-35">&#182;</a> </div> <h3>list-tubes</h3>
<p>lists all existing tubes</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">list_tubes</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
@@ -314,7 +332,7 @@
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;OK&#39;</span><span class="p">,</span>
<span class="nx">is_yaml</span><span class="o">:</span> <span class="mi">1</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-35"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-35">&#182;</a> </div> <h3>list-tubes-watched</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">&#182;</a> </div> <h3>list-tubes-watched</h3>
<p>lists all existing tubes that are currently watched</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">list_tubes_watched</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
@@ -322,27 +340,27 @@
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;OK&#39;</span><span class="p">,</span>
<span class="nx">is_yaml</span><span class="o">:</span> <span class="mi">1</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">&#182;</a> </div> <h3>list-tube-used</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <h3>list-tube-used</h3>
<p>returns the tube currently being used by the client</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">list_tube_used</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;list-tube-used\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;USING&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <h3>pause-tube</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <h3>pause-tube</h3>
<p>can delay any new job being reserved for a given time</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">pause_tube</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">tube</span><span class="p">,</span> <span class="nx">delay</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;pause-tube &#39;</span><span class="o">+</span><span class="nx">tube</span><span class="o">+</span><span class="s1">&#39; &#39;</span><span class="o">+</span><span class="nx">delay</span><span class="o">+</span><span class="s1">&#39;\r\n&#39;</span><span class="p">,</span>
<span class="nx">expected</span><span class="o">:</span> <span class="s1">&#39;PAUSED&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <h3>quit</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <h3>quit</h3>
<p>closes connection</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">BeanstalkClient</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">quit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">command</span><span class="p">({</span>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;quit\r\n&#39;</span>
<span class="p">});</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <h2>Exposed to node</h2> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Beanstalk</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">server</span><span class="p">)</span> <span class="p">{</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">&#182;</a> </div> <h2>Exposed to node</h2> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Beanstalk</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">server</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">c</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">BeanstalkClient</span><span class="p">;</span>
<span class="k">return</span> <span class="nx">c</span><span class="p">.</span><span class="nx">Instance</span><span class="p">(</span><span class="nx">server</span><span class="p">);</span>
<span class="p">};</span>
Please sign in to comment.
Something went wrong with that request. Please try again.