Methods
Public Instance
Public Instance methods
closed_for_select?()
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 79 def closed_for_select? 80 # @fiber-switch-guard 81 # a closed connection still holding requests will reconnect once the fiber closing its socket resumes. 82 super && @pending.empty? 83 end
current_context?()
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 67 def current_context? 68 @pending.any?(&:current_context?) || ( 69 @sibling && @sibling.pending.any?(&:current_context?) 70 ) 71 end
initial_call()
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 73 def initial_call 74 return unless current_context? 75 76 super 77 end
interests()
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 117 def interests 118 idling if (@state == :closed) && !no_more_requests? 119 120 super 121 end
on_connect_error(e)
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 99 def on_connect_error(e) 100 return super unless e.is_a?(IOError) && e.message.include?("stream closed in another thread") 101 102 # @fiber-switch-guard 103 # sockets closed during fiber scheduler switches are raised in separate fibers than the fiber the 104 # socket may be used in. this check verifies that this is actually about this socket. 105 unless to_io.closed? && !backlog? 106 call 107 return 108 end 109 110 super 111 end
on_io_error(e)
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 85 def on_io_error(e) 86 return super unless e.is_a?(IOError) && e.message.include?("stream closed in another thread") 87 88 # @fiber-switch-guard 89 # sockets closed during fiber scheduler switches are raised in separate fibers than the fiber the 90 # socket may be used in. this check verifies that this is actually about this socket. 91 unless to_io.closed? && !backlog? 92 call 93 return 94 end 95 96 super 97 end
pending_count()
[show source]
# File lib/httpx/plugins/fiber_concurrency.rb 113 def pending_count 114 @pending.count(&:current_context?) 115 end