Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

incremented version number for npm, re-rendered docco

  • Loading branch information...
commit 36f25227b54eee30b4e0254b53dabcd05acbca13 1 parent 22eec7e
@pascalopitz authored
Showing with 101 additions and 89 deletions.
  1. +100 −88 docs/beanstalk_client.html
  2. +1 −1  package.json
View
188 docs/beanstalk_client.html
@@ -1,25 +1,7 @@
<!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">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>
- <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">str</span><span class="p">.</span><span class="nx">replace</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">return</span> <span class="nx">str</span><span class="p">;</span>
- <span class="p">}</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>YAML sucks, reg exp to make it working(ish)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">corrected</span> <span class="o">=</span> <span class="nx">str</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\n-\ ([\w\d_-]+)/mig</span><span class="p">,</span> <span class="s1">&#39;\n - \&#39;$1\&#39;&#39;</span><span class="p">)</span> <span class="c1">//indent list</span>
- <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>
- <span class="nx">Debug</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">e</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">corrected</span><span class="p">);</span>
- <span class="k">return</span> <span class="nx">str</span><span class="p">;</span>
- <span class="p">}</span>
- <span class="p">};</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <h3>simple debug console</h3> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Debug</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="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>
+ <span class="nx">yaml</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;js-yaml&#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> <h3>simple debug console</h3> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Debug</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="kd">var</span> <span class="nx">active</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">log</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>
@@ -31,7 +13,7 @@
<span class="k">this</span><span class="p">.</span><span class="nx">activate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">active</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">};</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <h3>Job wrapper</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h3>Job wrapper</h3>
<p>returns an object that represents a job</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">BeanstalkJob</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">BeanstalkJob</span><span class="p">.</span><span class="nx">create</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>
@@ -42,15 +24,31 @@
<span class="p">};</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
-<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="p">};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#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">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>
- <span class="nx">callback</span><span class="p">(</span><span class="nx">data</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">onEnd</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</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_error&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">fn</span><span class="p">(</span><span class="nx">err</span><span class="p">,</span> <span class="kc">null</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_success&#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="nx">fn</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="nx">data</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="p">};</span>
+
+<span class="nx">BeanstalkCommand</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onError</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">fn</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_error&#39;</span><span class="p">,</span> <span class="nx">fn</span><span class="p">);</span>
+ <span class="k">return</span> <span class="k">this</span><span class="p">;</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">fn</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_success&#39;</span><span class="p">,</span> <span class="nx">fn</span><span class="p">);</span>
+ <span class="k">return</span> <span class="k">this</span><span class="p">;</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">responseHandler</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">obj</span><span class="p">,</span> <span class="nx">callback</span><span class="p">)</span> <span class="p">{</span>
@@ -58,17 +56,26 @@
<span class="kd">var</span> <span class="nx">chunks</span> <span class="o">=</span> <span class="nx">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">jobdata</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
- <span class="k">if</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">expected</span> <span class="o">!=</span> <span class="nx">chunks</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_done&#39;</span><span class="p">,</span> <span class="nx">chunks</span><span class="p">);</span>
+ <span class="kd">var</span> <span class="nx">expected</span> <span class="o">=</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">expected</span> <span class="o">===</span> <span class="s2">&quot;string&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="p">[</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">expected</span> <span class="p">]</span> <span class="o">:</span> <span class="nx">obj</span><span class="p">.</span><span class="nx">expected</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">expected_match</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
+
+ <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">expected</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span><span class="p">(</span><span class="nx">expected</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">===</span> <span class="nx">chunks</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
+ <span class="nx">expected_match</span> <span class="o">=</span> <span class="kc">true</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="nx">expected_match</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_error&#39;</span><span class="p">,</span> <span class="nx">chunks</span><span class="p">);</span>
<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
- <span class="p">}</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>handle multiline data correctly</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span><span class="p">(</span><span class="nx">lines</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
+ <span class="p">}</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>handle multiline data correctly</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span><span class="p">(</span><span class="nx">lines</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">lines</span><span class="p">.</span><span class="nx">pop</span><span class="p">();</span>
<span class="nx">lines</span><span class="p">.</span><span class="nx">shift</span><span class="p">();</span>
<span class="nx">jobdata</span> <span class="o">=</span> <span class="nx">lines</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39;\r\n&#39;</span><span class="p">);</span>
<span class="p">}</span>
- <span class="k">if</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">is_yaml</span><span class="p">)</span> <span class="p">{</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_done&#39;</span><span class="p">,</span> <span class="nx">yaml</span><span class="p">.</span><span class="nb">eval</span><span class="p">(</span><span class="nx">jobdata</span><span class="p">));</span>
+ <span class="k">if</span><span class="p">(</span><span class="nx">obj</span><span class="p">.</span><span class="nx">is_yaml</span> <span class="o">&amp;&amp;</span> <span class="nx">jobdata</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_success&#39;</span><span class="p">,</span> <span class="nx">yaml</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="nx">jobdata</span><span class="p">));</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">if</span><span class="p">(</span><span class="nx">chunks</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">chunks</span><span class="p">.</span><span class="nx">shift</span><span class="p">();</span>
@@ -80,11 +87,11 @@
<span class="p">}</span>
<span class="p">}</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_done&#39;</span><span class="p">,</span> <span class="nx">chunks</span><span class="p">);</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;command_success&#39;</span><span class="p">,</span> <span class="nx">chunks</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
-<span class="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <h2>Beanstalk client</h2>
+<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>Beanstalk client</h2>
<p>A client that binds to one single socket</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">BeanstalkClient</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>
@@ -97,45 +104,50 @@
<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">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>
- <span class="nx">p</span> <span class="o">=</span> <span class="nx">server</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</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-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#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">config</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">config</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">config</span> <span class="o">==</span> <span class="s1">&#39;string&#39;</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="nx">config</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">);</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">address</span> <span class="o">=</span> <span class="nx">c</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">||</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">port</span> <span class="o">=</span> <span class="nx">c</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="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">address</span> <span class="o">=</span> <span class="nx">config</span><span class="p">.</span><span class="nx">address</span> <span class="o">||</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">port</span> <span class="o">=</span> <span class="nx">config</span><span class="p">.</span><span class="nx">port</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="p">}</span>
<span class="p">}</span>
- <span class="k">this</span><span class="p">.</span><span class="nx">address</span> <span class="o">=</span> <span class="p">(</span><span class="nx">p</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">?</span> <span class="nx">p</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">:</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">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="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#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></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="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-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#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_success&#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-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>if the command fails, event an error</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_error&#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="nx">_self</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;end&#39;</span><span class="p">,</span> <span class="s1">&#39;Command failed&#39;</span><span class="p">);</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="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">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></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="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-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">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">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>
@@ -159,38 +171,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-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="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="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-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>
+<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>
<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-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <h3>watch</h3>
+<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>
<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-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <h3>ignore</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>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="nx">expected</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;WATCHING&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_IGNORED&#39;</span><span class="p">]</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>put</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>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>
@@ -209,21 +221,21 @@
<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">Buffer</span><span class="p">.</span><span class="nx">byteLength</span><span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">toString</span><span class="p">(),</span> <span class="s1">&#39;utf8&#39;</span><span class="p">)</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-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-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#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-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#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, 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-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <h3>touch</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> <p>camel case alias</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">reserveWithTimeout</span> <span class="o">=</span> <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="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>
@@ -275,30 +287,30 @@
<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="nx">expected</span><span class="o">:</span> <span class="p">[</span> <span class="s1">&#39;FOUND&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_FOUND&#39;</span> <span class="p">]</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-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="nx">expected</span><span class="o">:</span> <span class="p">[</span> <span class="s1">&#39;FOUND&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_FOUND&#39;</span> <span class="p">]</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-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> <p>camel case alias</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">peekReady</span> <span class="o">=</span> <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="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-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="nx">expected</span><span class="o">:</span> <span class="p">[</span> <span class="s1">&#39;FOUND&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_FOUND&#39;</span> <span class="p">]</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>peek-buried</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> <p>camel case alias</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">peekDelayed</span> <span class="o">=</span> <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="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>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="nx">expected</span><span class="o">:</span> <span class="p">[</span> <span class="s1">&#39;FOUND&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_FOUND&#39;</span> <span class="p">]</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</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> <p>camel case alias</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">peekBuried</span> <span class="o">=</span> <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="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>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>
@@ -306,15 +318,15 @@
<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-job</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>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>
<span class="nx">command</span><span class="o">:</span> <span class="s1">&#39;stats-job &#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;OK&#39;</span><span class="p">,</span>
+ <span class="nx">expected</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;OK&#39;</span><span class="p">,</span> <span class="s1">&#39;NOT_FOUND&#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>stats-tube</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> <p>camel case alias</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">statsJob</span> <span class="o">=</span> <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="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>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>
@@ -322,7 +334,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</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> <p>camel case alias</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">statsTube</span> <span class="o">=</span> <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="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> <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>
@@ -330,7 +342,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-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">&#182;</a> </div> <h3>list-tubes-watched</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">&#182;</a> </div> <p>camel case alias</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">listTubes</span> <span class="o">=</span> <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="p">;</span></pre></div> </td> </tr> <tr id="section-42"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-42">&#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>
@@ -338,27 +350,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-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <h3>list-tube-used</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-43"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-43">&#182;</a> </div> <p>camel case alias</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">listTubesWatched</span> <span class="o">=</span> <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="p">;</span></pre></div> </td> </tr> <tr id="section-44"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-44">&#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-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <h3>pause-tube</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-45"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-45">&#182;</a> </div> <p>camel case alias</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">listTubeUsed</span> <span class="o">=</span> <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="p">;</span></pre></div> </td> </tr> <tr id="section-46"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-46">&#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-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <h3>quit</h3>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-47"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-47">&#182;</a> </div> <p>camel case alias</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">pauseTube</span> <span class="o">=</span> <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="p">;</span></pre></div> </td> </tr> <tr id="section-48"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-48">&#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-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="p">};</span></pre></div> </td> </tr> <tr id="section-49"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-49">&#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>
View
2  package.json
@@ -2,7 +2,7 @@
"name": "nodestalker"
, "description": "A Beanstalk client for node.js"
, "keywords": ["beanstalkd", "queue"]
- , "version": "0.1.7"
+ , "version": "0.1.8"
, "author": "Pascal Opitz <contact@pascalopitz.com> (http://blog.pascalopitz.com)"
, "repository": {
"type": "git"
Please sign in to comment.
Something went wrong with that request. Please try again.