Sha256: 529a4dad1720b77587469f1502ce6f90ce567ea089b3e4d472f2490693459197
Contents?: true
Size: 900 Bytes
Versions: 18
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true require "websocket/driver" module ActionCable module Connection # = Action Cable \Connection \WebSocket # # Wrap the real socket to minimize the externally-presented API class WebSocket # :nodoc: def initialize(env, event_target, event_loop, protocols: ActionCable::INTERNAL[:protocols]) @websocket = ::WebSocket::Driver.websocket?(env) ? ClientSocket.new(env, event_target, event_loop, protocols) : nil end def possible? websocket end def alive? websocket && websocket.alive? end def transmit(data) websocket.transmit data end def close websocket.close end def protocol websocket.protocol end def rack_response websocket.rack_response end private attr_reader :websocket end end end
Version data entries
18 entries across 18 versions & 4 rubygems