Method: Hyperloop::Connection.active

Defined in:
lib/hyper-operation/transport/connection.rb

.activeObject



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/hyper-operation/transport/connection.rb', line 104

def active
  # if table doesn't exist then we are either calling from within
  # a migration or from a console before the server has ever started
  # in these cases there are no channels so we return nothing
  return [] unless table_exists?
  if Hyperloop.on_server?
    expired.delete_all
    refresh_connections if needs_refresh?
  end
  all.pluck(:channel).uniq
end