Module: Yahns::ClientExpireGeneric
- Defined in:
- lib/yahns/client_expire_generic.rb
Overview
Copyright © 2013-2016 all contributors <[email protected]> License: GPL-3.0+ (www.gnu.org/licenses/gpl-3.0.txt) frozen_string_literal: true
Instance Method Summary collapse
-
#__timestamp ⇒ Object
:nodoc:.
- #kgio_tryread(*args) ⇒ Object
- #kgio_trywrite(*args) ⇒ Object
- #trysendfile(*args) ⇒ Object
- #yahns_expire(timeout) ⇒ Object
- #yahns_init ⇒ Object
Instance Method Details
#__timestamp ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/yahns/client_expire_generic.rb', line 5 def Yahns.now end |
#kgio_tryread(*args) ⇒ Object
32 33 34 35 |
# File 'lib/yahns/client_expire_generic.rb', line 32 def kgio_tryread(*args) @last_io_at = super end |
#kgio_trywrite(*args) ⇒ Object
27 28 29 30 |
# File 'lib/yahns/client_expire_generic.rb', line 27 def kgio_trywrite(*args) @last_io_at = super end |
#trysendfile(*args) ⇒ Object
37 38 39 40 |
# File 'lib/yahns/client_expire_generic.rb', line 37 def trysendfile(*args) @last_io_at = super end |
#yahns_expire(timeout) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/yahns/client_expire_generic.rb', line 14 def yahns_expire(timeout) return 0 if closed? if ( - @last_io_at) > timeout shutdown 1 else 0 end # shutdown may race with the shutdown in http_response_done rescue 0 end |
#yahns_init ⇒ Object
9 10 11 12 |
# File 'lib/yahns/client_expire_generic.rb', line 9 def yahns_init super # Yahns::HttpClient#yahns_init @last_io_at = 0 end |