Class: XRBP::WebSocket::Prioritized

Inherits:
MultiConnection show all
Defined in:
lib/xrbp/websocket/multi/prioritized.rb

Overview

MultiConnection strategy where connections are tried sequentially until one succeeds

Instance Attribute Summary

Attributes inherited from MultiConnection

#connections

Instance Method Summary collapse

Methods inherited from MultiConnection

#_add_plugin, #add_plugin, #close!, #connect, #force_quit!, #initialize, #plugin_namespace, #wait_for_close, #wait_for_completed, #wait_for_open

Constructor Details

This class inherits a constructor from XRBP::WebSocket::MultiConnection

Instance Method Details

#next_connection(prev = nil) ⇒ Object



6
7
8
9
10
# File 'lib/xrbp/websocket/multi/prioritized.rb', line 6

def next_connection(prev=nil)
  return nil if prev == connections.last
  return super if prev.nil?
  connections[connections.index(prev)+1]
end