| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title> |
| Class: Qpid::Proton::HandlerDriver |
| |
| — Qpid Proton Ruby API |
| |
| </title> |
| |
| <link rel="stylesheet" href="../../css/style.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../../css/common.css" type="text/css" /> |
| |
| <script type="text/javascript"> |
| pathId = "Qpid::Proton::HandlerDriver"; |
| relpath = '../../'; |
| </script> |
| |
| |
| <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script> |
| |
| <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script> |
| |
| |
| </head> |
| <body> |
| <div class="nav_wrap"> |
| <iframe id="nav" src="../../class_list.html?1"></iframe> |
| <div id="resizer"></div> |
| </div> |
| |
| <div id="main" tabindex="-1"> |
| <div id="header"> |
| <div id="menu"> |
| |
| <a href="../../_index.html">Index (H)</a> » |
| <span class='title'><span class='object_link'><a href="../../Qpid.html" title="Qpid (module)">Qpid</a></span></span> » <span class='title'><span class='object_link'><a href="../Proton.html" title="Qpid::Proton (module)">Proton</a></span></span> |
| » |
| <span class="title">HandlerDriver</span> |
| |
| </div> |
| |
| <div id="search"> |
| |
| <a class="full_list_link" id="class_list_link" |
| href="../../class_list.html"> |
| |
| <svg width="24" height="24"> |
| <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> |
| <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> |
| <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> |
| </svg> |
| </a> |
| |
| </div> |
| <div class="clear"></div> |
| </div> |
| |
| <div id="content"><h1>Class: Qpid::Proton::HandlerDriver |
| |
| |
| |
| </h1> |
| <div class="box_info"> |
| |
| <dl> |
| <dt>Inherits:</dt> |
| <dd> |
| <span class="inheritName"><span class='object_link'><a href="ConnectionDriver.html" title="Qpid::Proton::ConnectionDriver (class)">ConnectionDriver</a></span></span> |
| |
| <ul class="fullTree"> |
| <li>Object</li> |
| |
| <li class="next"><span class='object_link'><a href="ConnectionDriver.html" title="Qpid::Proton::ConnectionDriver (class)">ConnectionDriver</a></span></li> |
| |
| <li class="next">Qpid::Proton::HandlerDriver</li> |
| |
| </ul> |
| <a href="#" class="inheritanceTree">show all</a> |
| |
| </dd> |
| </dl> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <dl> |
| <dt>Defined in:</dt> |
| <dd>lib/core/connection_driver.rb</dd> |
| </dl> |
| |
| </div> |
| |
| <h2>Overview</h2><div class="docstring"> |
| <div class="discussion"> |
| |
| <p>A <span class='object_link'><a href="ConnectionDriver.html" title="Qpid::Proton::ConnectionDriver (class)">ConnectionDriver</a></span> that feeds raw proton events to a handler.</p> |
| |
| |
| </div> |
| </div> |
| <div class="tags"> |
| |
| |
| </div><div id="subclasses"> |
| <h2>Direct Known Subclasses</h2> |
| <p class="children"><span class='object_link'><a href="Container/ConnectionTask.html" title="Qpid::Proton::Container::ConnectionTask (class)">Container::ConnectionTask</a></span></p> |
| </div> |
| |
| |
| |
| |
| <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2> |
| <ul class="summary"> |
| |
| <li class="public "> |
| <span class="summary_signature"> |
| |
| <a href="#handler-instance_method" title="#handler (instance method)">#<strong>handler</strong> ⇒ MessagingHandler </a> |
| |
| |
| |
| </span> |
| |
| |
| |
| |
| <span class="note title readonly">readonly</span> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <span class="summary_desc"><div class='inline'> |
| <p>The handler dispatched to by <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span>.</p> |
| </div></span> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| |
| <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="ConnectionDriver.html" title="Qpid::Proton::ConnectionDriver (class)">ConnectionDriver</a></span></h3> |
| <p class="inherited"><span class='object_link'><a href="ConnectionDriver.html#next_tick-instance_method" title="Qpid::Proton::ConnectionDriver#next_tick (method)">#next_tick</a></span></p> |
| |
| |
| |
| <h2> |
| Instance Method Summary |
| <small><a href="#" class="summary_toggle">collapse</a></small> |
| </h2> |
| |
| <ul class="summary"> |
| |
| <li class="public "> |
| <span class="summary_signature"> |
| |
| <a href="#dispatch-instance_method" title="#dispatch (instance method)">#<strong>dispatch</strong> </a> |
| |
| |
| |
| </span> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <span class="summary_desc"><div class='inline'> |
| <p>Dispatch all available raw proton events from <span class='object_link'><a href="ConnectionDriver.html#event-instance_method" title="Qpid::Proton::ConnectionDriver#event (method)">ConnectionDriver#event</a></span> to <span class='object_link'><a href="#handler-instance_method" title="Qpid::Proton::HandlerDriver#handler (method)">#handler</a></span>.</p> |
| </div></span> |
| |
| </li> |
| |
| |
| <li class="public "> |
| <span class="summary_signature"> |
| |
| <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(io, handler) ⇒ HandlerDriver </a> |
| |
| |
| |
| </span> |
| |
| |
| <span class="note title constructor">constructor</span> |
| |
| |
| |
| |
| |
| |
| |
| |
| <span class="summary_desc"><div class='inline'> |
| <p>Combine an IO with a handler and provide a simplified way to run the driver via <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span>.</p> |
| </div></span> |
| |
| </li> |
| |
| |
| <li class="public "> |
| <span class="summary_signature"> |
| |
| <a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong>(now = Time.now) ⇒ Time </a> |
| |
| |
| |
| </span> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <span class="summary_desc"><div class='inline'> |
| <p>Do <span class='object_link'><a href="ConnectionDriver.html#read-instance_method" title="Qpid::Proton::ConnectionDriver#read (method)">ConnectionDriver#read</a></span>, <span class='object_link'><a href="ConnectionDriver.html#tick-instance_method" title="Qpid::Proton::ConnectionDriver#tick (method)">ConnectionDriver#tick</a></span>, <span class='object_link'><a href="ConnectionDriver.html#write-instance_method" title="Qpid::Proton::ConnectionDriver#write (method)">ConnectionDriver#write</a></span> and <span class='object_link'><a href="#dispatch-instance_method" title="Qpid::Proton::HandlerDriver#dispatch (method)">#dispatch</a></span> without blocking.</p> |
| </div></span> |
| |
| </li> |
| |
| |
| </ul> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <h3 class="inherited">Methods inherited from <span class='object_link'><a href="ConnectionDriver.html" title="Qpid::Proton::ConnectionDriver (class)">ConnectionDriver</a></span></h3> |
| <p class="inherited"><span class='object_link'><a href="ConnectionDriver.html#can_read%3F-instance_method" title="Qpid::Proton::ConnectionDriver#can_read? (method)">#can_read?</a></span>, <span class='object_link'><a href="ConnectionDriver.html#can_write%3F-instance_method" title="Qpid::Proton::ConnectionDriver#can_write? (method)">#can_write?</a></span>, <span class='object_link'><a href="ConnectionDriver.html#close-instance_method" title="Qpid::Proton::ConnectionDriver#close (method)">#close</a></span>, <span class='object_link'><a href="ConnectionDriver.html#close_read-instance_method" title="Qpid::Proton::ConnectionDriver#close_read (method)">#close_read</a></span>, <span class='object_link'><a href="ConnectionDriver.html#close_write-instance_method" title="Qpid::Proton::ConnectionDriver#close_write (method)">#close_write</a></span>, <span class='object_link'><a href="ConnectionDriver.html#connection-instance_method" title="Qpid::Proton::ConnectionDriver#connection (method)">#connection</a></span>, <span class='object_link'><a href="ConnectionDriver.html#each_event-instance_method" title="Qpid::Proton::ConnectionDriver#each_event (method)">#each_event</a></span>, <span class='object_link'><a href="ConnectionDriver.html#event-instance_method" title="Qpid::Proton::ConnectionDriver#event (method)">#event</a></span>, <span class='object_link'><a href="ConnectionDriver.html#event%3F-instance_method" title="Qpid::Proton::ConnectionDriver#event? (method)">#event?</a></span>, <span class='object_link'><a href="ConnectionDriver.html#finished%3F-instance_method" title="Qpid::Proton::ConnectionDriver#finished? (method)">#finished?</a></span>, <span class='object_link'><a href="ConnectionDriver.html#read-instance_method" title="Qpid::Proton::ConnectionDriver#read (method)">#read</a></span>, <span class='object_link'><a href="ConnectionDriver.html#read_closed%3F-instance_method" title="Qpid::Proton::ConnectionDriver#read_closed? (method)">#read_closed?</a></span>, <span class='object_link'><a href="ConnectionDriver.html#tick-instance_method" title="Qpid::Proton::ConnectionDriver#tick (method)">#tick</a></span>, <span class='object_link'><a href="ConnectionDriver.html#to_io-instance_method" title="Qpid::Proton::ConnectionDriver#to_io (method)">#to_io</a></span>, <span class='object_link'><a href="ConnectionDriver.html#transport-instance_method" title="Qpid::Proton::ConnectionDriver#transport (method)">#transport</a></span>, <span class='object_link'><a href="ConnectionDriver.html#write-instance_method" title="Qpid::Proton::ConnectionDriver#write (method)">#write</a></span>, <span class='object_link'><a href="ConnectionDriver.html#write_closed%3F-instance_method" title="Qpid::Proton::ConnectionDriver#write_closed? (method)">#write_closed?</a></span></p> |
| <div id="constructor_details" class="method_details_list"> |
| <h2>Constructor Details</h2> |
| |
| <div class="method_details first"> |
| <h3 class="signature first" id="initialize-instance_method"> |
| |
| #<strong>initialize</strong>(io, handler) ⇒ <tt><span class='object_link'><a href="" title="Qpid::Proton::HandlerDriver (class)">HandlerDriver</a></span></tt> |
| |
| |
| |
| |
| |
| </h3><div class="docstring"> |
| <div class="discussion"> |
| |
| <p>Combine an IO with a handler and provide a simplified way to run the driver via <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span></p> |
| |
| |
| </div> |
| </div> |
| <div class="tags"> |
| <p class="tag_title">Parameters:</p> |
| <ul class="param"> |
| |
| <li> |
| |
| <span class='name'>io</span> |
| |
| |
| <span class='type'>(<tt>IO</tt>)</span> |
| |
| |
| |
| </li> |
| |
| <li> |
| |
| <span class='name'>handler</span> |
| |
| |
| <span class='type'>(<tt><span class='object_link'><a href="Handler/MessagingHandler.html" title="Qpid::Proton::Handler::MessagingHandler (class)">Handler::MessagingHandler</a></span></tt>)</span> |
| |
| |
| |
| — |
| <div class='inline'> |
| <p>to receive raw events in <span class='object_link'><a href="#dispatch-instance_method" title="Qpid::Proton::HandlerDriver#dispatch (method)">#dispatch</a></span> and <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span></p> |
| </div> |
| |
| </li> |
| |
| </ul> |
| |
| |
| </div><table class="source_code"> |
| <tr> |
| <td> |
| <pre class="lines"> |
| |
| |
| 177 |
| 178 |
| 179 |
| 180 |
| 181</pre> |
| </td> |
| <td> |
| <pre class="code"><span class="info file"># File 'lib/core/connection_driver.rb', line 177</span> |
| |
| <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='comma'>,</span> <span class='id identifier rubyid_handler'>handler</span><span class='rparen'>)</span> |
| <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_io'>io</span><span class='rparen'>)</span> |
| <span class='ivar'>@handler</span> <span class='op'>=</span> <span class='id identifier rubyid_handler'>handler</span> |
| <span class='ivar'>@adapter</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Handler.html" title="Qpid::Proton::Handler (module)">Handler</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Handler/Adapter.html" title="Qpid::Proton::Handler::Adapter (class)">Adapter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_adapt'><span class='object_link'><a href="Handler/Adapter.html#adapt-class_method" title="Qpid::Proton::Handler::Adapter.adapt (method)">adapt</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_handler'>handler</span><span class='rparen'>)</span> |
| <span class='kw'>end</span></pre> |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| |
| <div id="instance_attr_details" class="attr_details"> |
| <h2>Instance Attribute Details</h2> |
| |
| |
| <span id=""></span> |
| <div class="method_details first"> |
| <h3 class="signature first" id="handler-instance_method"> |
| |
| #<strong>handler</strong> ⇒ <tt><span class='object_link'><a href="MessagingHandler.html" title="Qpid::Proton::MessagingHandler (class)">MessagingHandler</a></span></tt> <span class="extras">(readonly)</span> |
| |
| |
| |
| |
| |
| </h3><div class="docstring"> |
| <div class="discussion"> |
| |
| <p>Returns The handler dispatched to by <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span>.</p> |
| |
| |
| </div> |
| </div> |
| <div class="tags"> |
| |
| <p class="tag_title">Returns:</p> |
| <ul class="return"> |
| |
| <li> |
| |
| |
| <span class='type'>(<tt><span class='object_link'><a href="MessagingHandler.html" title="Qpid::Proton::MessagingHandler (class)">MessagingHandler</a></span></tt>)</span> |
| |
| |
| |
| — |
| <div class='inline'> |
| <p>The handler dispatched to by <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span></p> |
| </div> |
| |
| </li> |
| |
| </ul> |
| |
| </div><table class="source_code"> |
| <tr> |
| <td> |
| <pre class="lines"> |
| |
| |
| 184 |
| 185 |
| 186</pre> |
| </td> |
| <td> |
| <pre class="code"><span class="info file"># File 'lib/core/connection_driver.rb', line 184</span> |
| |
| <span class='kw'>def</span> <span class='id identifier rubyid_handler'>handler</span> |
| <span class='ivar'>@handler</span> |
| <span class='kw'>end</span></pre> |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| |
| |
| <div id="instance_method_details" class="method_details_list"> |
| <h2>Instance Method Details</h2> |
| |
| |
| <div class="method_details first"> |
| <h3 class="signature first" id="dispatch-instance_method"> |
| |
| #<strong>dispatch</strong> |
| |
| |
| |
| |
| |
| </h3><div class="docstring"> |
| <div class="discussion"> |
| |
| <p>Dispatch all available raw proton events from <span class='object_link'><a href="ConnectionDriver.html#event-instance_method" title="Qpid::Proton::ConnectionDriver#event (method)">ConnectionDriver#event</a></span> to <span class='object_link'><a href="#handler-instance_method" title="Qpid::Proton::HandlerDriver#handler (method)">#handler</a></span></p> |
| |
| |
| </div> |
| </div> |
| <div class="tags"> |
| |
| |
| </div><table class="source_code"> |
| <tr> |
| <td> |
| <pre class="lines"> |
| |
| |
| 187 |
| 188 |
| 189 |
| 190 |
| 191 |
| 192 |
| 193 |
| 194 |
| 195 |
| 196</pre> |
| </td> |
| <td> |
| <pre class="code"><span class="info file"># File 'lib/core/connection_driver.rb', line 187</span> |
| |
| <span class='kw'>def</span> <span class='id identifier rubyid_dispatch'>dispatch</span><span class='lparen'>(</span><span class='rparen'>)</span> |
| <span class='id identifier rubyid_each_event'>each_event</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_e'>e</span><span class='op'>|</span> |
| <span class='kw'>case</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span> <span class='comment'># Events that affect the driver |
| </span> <span class='kw'>when</span> <span class='symbol'>:on_transport_tail_closed</span> <span class='kw'>then</span> <span class='id identifier rubyid_close_read'>close_read</span> |
| <span class='kw'>when</span> <span class='symbol'>:on_transport_head_closed</span> <span class='kw'>then</span> <span class='id identifier rubyid_close_write'>close_write</span> |
| <span class='kw'>when</span> <span class='symbol'>:on_transport_closed</span> <span class='kw'>then</span> <span class='ivar'>@io</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='kw'>rescue</span> <span class='kw'>nil</span> <span class='comment'># Allow double-close |
| </span> <span class='kw'>end</span> |
| <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_dispatch'>dispatch</span> <span class='ivar'>@adapter</span> |
| <span class='kw'>end</span> |
| <span class='kw'>end</span></pre> |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| <div class="method_details "> |
| <h3 class="signature " id="process-instance_method"> |
| |
| #<strong>process</strong>(now = Time.now) ⇒ <tt>Time</tt> |
| |
| |
| |
| |
| |
| </h3><div class="docstring"> |
| <div class="discussion"> |
| |
| <p>Do <span class='object_link'><a href="ConnectionDriver.html#read-instance_method" title="Qpid::Proton::ConnectionDriver#read (method)">ConnectionDriver#read</a></span>, <span class='object_link'><a href="ConnectionDriver.html#tick-instance_method" title="Qpid::Proton::ConnectionDriver#tick (method)">ConnectionDriver#tick</a></span>, <span class='object_link'><a href="ConnectionDriver.html#write-instance_method" title="Qpid::Proton::ConnectionDriver#write (method)">ConnectionDriver#write</a></span> and <span class='object_link'><a href="#dispatch-instance_method" title="Qpid::Proton::HandlerDriver#dispatch (method)">#dispatch</a></span> without blocking.</p> |
| |
| |
| </div> |
| </div> |
| <div class="tags"> |
| <p class="tag_title">Parameters:</p> |
| <ul class="param"> |
| |
| <li> |
| |
| <span class='name'>now</span> |
| |
| |
| <span class='type'>(<tt>Time</tt>)</span> |
| |
| |
| <em class="default">(defaults to: <tt>Time.now</tt>)</em> |
| |
| |
| — |
| <div class='inline'> |
| <p>the current time</p> |
| </div> |
| |
| </li> |
| |
| </ul> |
| |
| <p class="tag_title">Returns:</p> |
| <ul class="return"> |
| |
| <li> |
| |
| |
| <span class='type'>(<tt>Time</tt>)</span> |
| |
| |
| |
| — |
| <div class='inline'> |
| <p>Latest time to call <span class='object_link'><a href="#process-instance_method" title="Qpid::Proton::HandlerDriver#process (method)">#process</a></span> again for scheduled events, or nil if there are no scheduled events</p> |
| </div> |
| |
| </li> |
| |
| </ul> |
| |
| </div><table class="source_code"> |
| <tr> |
| <td> |
| <pre class="lines"> |
| |
| |
| 202 |
| 203 |
| 204 |
| 205 |
| 206 |
| 207 |
| 208 |
| 209 |
| 210</pre> |
| </td> |
| <td> |
| <pre class="code"><span class="info file"># File 'lib/core/connection_driver.rb', line 202</span> |
| |
| <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_now'>now</span><span class='op'>=</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='rparen'>)</span> |
| <span class='id identifier rubyid_read'>read</span> |
| <span class='id identifier rubyid_dispatch'>dispatch</span> |
| <span class='id identifier rubyid_next_tick'>next_tick</span> <span class='op'>=</span> <span class='id identifier rubyid_tick'>tick</span><span class='lparen'>(</span><span class='id identifier rubyid_now'>now</span><span class='rparen'>)</span> |
| <span class='id identifier rubyid_dispatch'>dispatch</span> |
| <span class='id identifier rubyid_write'>write</span> |
| <span class='id identifier rubyid_dispatch'>dispatch</span> |
| <span class='kw'>return</span> <span class='id identifier rubyid_next_tick'>next_tick</span> |
| <span class='kw'>end</span></pre> |
| </td> |
| </tr> |
| </table> |
| </div> |
| |
| </div> |
| |
| </div> |
| |
| <div id="footer"> |
| Generated on Wed Nov 11 12:57:53 2020 by |
| <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> |
| 0.9.24 (ruby-2.7.2). |
| </div> |
| |
| </div> |
| </body> |
| </html> |