/lib/gems/doc/httpclient-2.2.0.2/rdoc/HTTPClient/Timeout.html
HTML | 291 lines | 164 code | 120 blank | 7 comment | 0 complexity | 520bd0c022b76dd3942386029b325f78 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
- <title>Module: HTTPClient::Timeout</title>
- <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
- <script src="../js/jquery.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../js/thickbox-compressed.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../js/quicksearch.js" type="text/javascript"
- charset="utf-8"></script>
- <script src="../js/darkfish.js" type="text/javascript"
- charset="utf-8"></script>
- </head>
- <body class="module">
- <div id="metadata">
- <div id="home-metadata">
- <div id="home-section" class="section">
- <h3 class="section-header">
- <a href="../index.html">Home</a>
- <a href="../index.html#classes">Classes</a>
- <a href="../index.html#methods">Methods</a>
- </h3>
- </div>
- </div>
- <div id="file-metadata">
- <div id="file-list-section" class="section">
- <h3 class="section-header">In Files</h3>
- <div class="section-body">
- <ul>
-
- <li><a href="../lib/httpclient/timeout_rb.html?TB_iframe=true&height=550&width=785"
- class="thickbox" title="lib/httpclient/timeout.rb">lib/httpclient/timeout.rb</a></li>
-
- </ul>
- </div>
- </div>
-
- </div>
- <div id="class-metadata">
- <!-- Parent Class -->
-
- <!-- Namespace Contents -->
-
- <!-- Method Quickref -->
-
- <div id="method-list-section" class="section">
- <h3 class="section-header">Methods</h3>
- <ul class="link-list">
-
- <li><a href="#method-i-timeout">#timeout</a></li>
-
- </ul>
- </div>
-
- <!-- Included Modules -->
-
- </div>
- <div id="project-metadata">
-
-
- <div id="classindex-section" class="section project-section">
- <h3 class="section-header">Class Index
- <span class="search-toggle"><img src="../images/find.png"
- height="16" width="16" alt="[+]"
- title="show/hide quicksearch" /></span></h3>
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
- <fieldset>
- <legend>Quicksearch</legend>
- <input type="text" name="quicksearch" value=""
- class="quicksearch-field" />
- </fieldset>
- </form>
- <ul class="link-list">
-
- <li><a href="../HTTPClient.html">HTTPClient</a></li>
-
- <li><a href="../HTTPClient/AuthFilterBase.html">HTTPClient::AuthFilterBase</a></li>
-
- <li><a href="../HTTPClient/BadResponseError.html">HTTPClient::BadResponseError</a></li>
-
- <li><a href="../HTTPClient/BadResponseError.html">HTTPClient::BadResponseError</a></li>
-
- <li><a href="../HTTPClient/BasicAuth.html">HTTPClient::BasicAuth</a></li>
-
- <li><a href="../HTTPClient/ConfigurationError.html">HTTPClient::ConfigurationError</a></li>
-
- <li><a href="../HTTPClient/ConnectTimeoutError.html">HTTPClient::ConnectTimeoutError</a></li>
-
- <li><a href="../HTTPClient/Connection.html">HTTPClient::Connection</a></li>
-
- <li><a href="../HTTPClient/DebugSocket.html">HTTPClient::DebugSocket</a></li>
-
- <li><a href="../HTTPClient/DigestAuth.html">HTTPClient::DigestAuth</a></li>
-
- <li><a href="../HTTPClient/LoopBackSocket.html">HTTPClient::LoopBackSocket</a></li>
-
- <li><a href="../HTTPClient/NegotiateAuth.html">HTTPClient::NegotiateAuth</a></li>
-
- <li><a href="../HTTPClient/OAuth.html">HTTPClient::OAuth</a></li>
-
- <li><a href="../HTTPClient/OAuth/Config.html">HTTPClient::OAuth::Config</a></li>
-
- <li><a href="../HTTPClient/ProxyAuth.html">HTTPClient::ProxyAuth</a></li>
-
- <li><a href="../HTTPClient/ReceiveTimeoutError.html">HTTPClient::ReceiveTimeoutError</a></li>
-
- <li><a href="../HTTPClient/SSLConfig.html">HTTPClient::SSLConfig</a></li>
-
- <li><a href="../HTTPClient/SSLSocketWrap.html">HTTPClient::SSLSocketWrap</a></li>
-
- <li><a href="../HTTPClient/SSPINegotiateAuth.html">HTTPClient::SSPINegotiateAuth</a></li>
-
- <li><a href="../HTTPClient/SendTimeoutError.html">HTTPClient::SendTimeoutError</a></li>
-
- <li><a href="../HTTPClient/Session.html">HTTPClient::Session</a></li>
-
- <li><a href="../HTTPClient/SessionManager.html">HTTPClient::SessionManager</a></li>
-
- <li><a href="../HTTPClient/Site.html">HTTPClient::Site</a></li>
-
- <li><a href="../HTTPClient/SocketWrap.html">HTTPClient::SocketWrap</a></li>
-
- <li><a href="../HTTPClient/Timeout.html">HTTPClient::Timeout</a></li>
-
- <li><a href="../HTTPClient/TimeoutError.html">HTTPClient::TimeoutError</a></li>
-
- <li><a href="../HTTPClient/TimeoutScheduler.html">HTTPClient::TimeoutScheduler</a></li>
-
- <li><a href="../HTTPClient/TimeoutScheduler/Period.html">HTTPClient::TimeoutScheduler::Period</a></li>
-
- <li><a href="../HTTPClient/Util.html">HTTPClient::Util</a></li>
-
- <li><a href="../HTTPClient/WWWAuth.html">HTTPClient::WWWAuth</a></li>
-
- <li><a href="../HTTPAccess2.html">HTTPAccess2</a></li>
-
- <li><a href="../HTTPAccess2/Client.html">HTTPAccess2::Client</a></li>
-
- <li><a href="../HTTPAccess2/Client/RetryableResponse.html">HTTPAccess2::Client::RetryableResponse</a></li>
-
- <li><a href="../HTTPAccess2/Session.html">HTTPAccess2::Session</a></li>
-
- <li><a href="../HTTPAccess2/Session/BadResponse.html">HTTPAccess2::Session::BadResponse</a></li>
-
- <li><a href="../HTTPAccess2/Session/Error.html">HTTPAccess2::Session::Error</a></li>
-
- <li><a href="../HTTPAccess2/Session/InvalidState.html">HTTPAccess2::Session::InvalidState</a></li>
-
- <li><a href="../HTTPAccess2/Session/KeepAliveDisconnected.html">HTTPAccess2::Session::KeepAliveDisconnected</a></li>
-
- <li><a href="../WebAgent.html">WebAgent</a></li>
-
- <li><a href="../WebAgent/Cookie.html">WebAgent::Cookie</a></li>
-
- <li><a href="../WebAgent/CookieManager.html">WebAgent::CookieManager</a></li>
-
- <li><a href="../WebAgent/CookieManager/Error.html">WebAgent::CookieManager::Error</a></li>
-
- <li><a href="../WebAgent/CookieManager/ErrorOverrideOK.html">WebAgent::CookieManager::ErrorOverrideOK</a></li>
-
- <li><a href="../WebAgent/CookieManager/SpecialError.html">WebAgent::CookieManager::SpecialError</a></li>
-
- <li><a href="../WebAgent/CookieUtils.html">WebAgent::CookieUtils</a></li>
-
- <li><a href="../HTTP.html">HTTP</a></li>
-
- <li><a href="../HTTP/Message.html">HTTP::Message</a></li>
-
- <li><a href="../HTTP/Message/Body.html">HTTP::Message::Body</a></li>
-
- <li><a href="../HTTP/Message/Body/Parts.html">HTTP::Message::Body::Parts</a></li>
-
- <li><a href="../HTTP/Message/Headers.html">HTTP::Message::Headers</a></li>
-
- <li><a href="../HTTP/Status.html">HTTP::Status</a></li>
-
- <li><a href="../HexDump.html">HexDump</a></li>
-
- <li><a href="../OAuthClient.html">OAuthClient</a></li>
-
- <li><a href="../String.html">String</a></li>
-
- </ul>
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
- </div>
-
- </div>
- </div>
- <div id="documentation">
- <h1 class="module">HTTPClient::Timeout</h1>
- <div id="description">
-
- </div>
- <!-- Constants -->
-
- <!-- Attributes -->
-
- <!-- Methods -->
-
- <div id="public-instance-method-details" class="method-section section">
- <h3 class="section-header">Public Instance Methods</h3>
-
- <div id="timeout-method" class="method-detail ">
- <a name="method-i-timeout"></a>
- <div class="method-heading">
-
- <span class="method-name">timeout</span><span
- class="method-args">(sec, ex = nil, &block)</span>
- <span class="method-click-advice">click to toggle source</span>
-
- </div>
- <div class="method-description">
-
-
-
-
- <div class="method-source-code"
- id="timeout-source">
- <pre>
- <span class="ruby-comment cmt"># File lib/httpclient/timeout.rb, line 125</span>
- 125: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">sec</span>, <span class="ruby-identifier">ex</span> = <span class="ruby-keyword kw">nil</span>, &<span class="ruby-identifier">block</span>)
- 126: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sec</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">sec</span>.<span class="ruby-identifier">zero?</span>
- 127: <span class="ruby-identifier">scheduler</span> = <span class="ruby-keyword kw">nil</span>
- 128: <span class="ruby-keyword kw">begin</span>
- 129: <span class="ruby-identifier">scheduler</span> = <span class="ruby-constant">HTTPClient</span>.<span class="ruby-identifier">timeout_scheduler</span>
- 130: <span class="ruby-identifier">period</span> = <span class="ruby-identifier">scheduler</span>.<span class="ruby-identifier">register</span>(<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>, <span class="ruby-identifier">sec</span>, <span class="ruby-identifier">ex</span>)
- 131: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">sec</span>)
- 132: <span class="ruby-keyword kw">ensure</span>
- 133: <span class="ruby-identifier">scheduler</span>.<span class="ruby-identifier">cancel</span>(<span class="ruby-identifier">period</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">scheduler</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">period</span>
- 134: <span class="ruby-keyword kw">end</span>
- 135: <span class="ruby-keyword kw">end</span></pre>
- </div>
-
- </div>
-
-
- </div>
-
- </div>
-
- </div>
- <div id="rdoc-debugging-section-dump" class="debugging-section">
-
- <p>Disabled; run with --debug to generate this.</p>
-
- </div>
- <div id="validator-badges">
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
- Rdoc Generator</a> 1.1.6</small>.</p>
- </div>
- </body>
- </html>