lib/httpx/connection.rb in httpx-0.0.4 vs lib/httpx/connection.rb in httpx-0.0.5
- old
+ new
@@ -14,25 +14,26 @@
def running?
!@channels.empty?
end
- def next_tick(timeout: @timeout.timeout)
+ def next_tick
+ timeout = @timeout.timeout
@selector.select(timeout) do |monitor|
if (channel = monitor.value)
channel.call
end
monitor.interests = channel.interests
end
+ rescue TimeoutError => ex
+ @channels.each do |ch|
+ ch.emit(:error, ex)
+ end
end
def close
@channels.each(&:close)
next_tick until @channels.empty?
- end
-
- def reset
- @channels.each(&:reset)
end
def build_channel(uri, **options)
channel = Channel.by(uri, @options.merge(options))
register_channel(channel)