class XRBP::WebSocket::Fallback

MultiConnection strategy where connections are tried sequentially until one is found that is open & succeeds

Public Instance Methods

next_connection(prev=nil) click to toggle source
# File lib/xrbp/websocket/multi/fallback.rb, line 6
def next_connection(prev=nil)
  unless prev.nil?
    return nil if connections.last == prev
    return connections[(connections.index(prev) + 1)..-1].find { |c| !c.closed? }
  end

  connections.find { |c| !c.closed? }
end