doc/index.html in ezmq-0.3.7 vs doc/index.html in ezmq-0.4.0
- old
+ new
@@ -82,11 +82,13 @@
<p>Waits for a request, replies with the same request.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
-<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span>
+<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
+ <span class='id identifier rubyid_message'>message</span>
+<span class='kw'>end</span>
</code></pre>
<h2>Synchronous Client Request</h2>
<p>Sends a message, prints the reply when it arrives.</p>
@@ -116,11 +118,13 @@
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>json</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_server'>server</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='op'>::</span><span class='const'>Server</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>encode:</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_m'>m</span> <span class='tlambeg'>{</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='id identifier rubyid_m'>m</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>decode:</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_m'>m</span> <span class='tlambeg'>{</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='id identifier rubyid_m'>m</span> <span class='rbrace'>}</span>
-<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span>
+<span class='id identifier rubyid_server'>server</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
+ <span class='id identifier rubyid_message'>message</span>
+<span class='kw'>end</span>
</code></pre>
<h2>JSON Synchronous Client Request</h2>
<p>Encodes a message in JSON, sends it twice, prints the first one raw, and decodes the second.</p>
@@ -152,11 +156,13 @@
<p>Subscribes to topic 'foorever', prints any messages it receives.</p>
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_subscriber'>subscriber</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='period'>.</span><span class='const'>Subscriber</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>topic:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foorever</span><span class='tstring_end'>'</span></span>
-<span class='id identifier rubyid_subscriber'>subscriber</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span>
+<span class='id identifier rubyid_subscriber'>subscriber</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_topic'>topic</span><span class='op'>|</span>
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_topic'>topic</span> <span class='embexpr_end'>}</span><span class='tstring_content'>] </span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_message'>message</span> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
+<span class='kw'>end</span>
</code></pre>
<h2>Pipeline Work Generator</h2>
<p>Generates work, distributes it to workers via PUSH socket.</p>
@@ -206,11 +212,13 @@
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>json</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_collector'>collector</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='op'>::</span><span class='const'>Puller</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>port:</span> <span class='int'>5556</span>
-<span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span>
+<span class='id identifier rubyid_collector'>collector</span><span class='period'>.</span><span class='id identifier rubyid_listen'>listen</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_message'>message</span><span class='op'>|</span>
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_message'>message</span>
+<span class='kw'>end</span>
</code></pre>
<h1>Operating System Notes</h1>
<p>As this relies on <a href="https://github.com/chuckremes/ffi-rzmq">ffi-rzmq</a>, you will need to have the zeromq libraries available.</p>
@@ -228,10 +236,10 @@
<p>For Windows, you should really consult the <a href="http://zeromq.org/docs:windows-installations">ØMQ documentation</a>.</p>
</div></div>
<div id="footer">
- Generated on Mon Feb 2 15:37:50 2015 by
+ Generated on Tue Feb 3 09:55:04 2015 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.7.6 (ruby-2.0.0).
</div>
</body>
\ No newline at end of file