Class: Async::WebSocket::Server

Inherits:
Protocol::HTTP::Middleware
  • Object
show all
Includes:
Protocol::WebSocket::Headers
Defined in:
lib/async/websocket/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(delegate, **options, &block) ⇒ Server

Returns a new instance of Server.



17
18
19
20
21
22
# File 'lib/async/websocket/server.rb', line 17

def initialize(delegate, **options, &block)
  super(delegate)
  
  @options = options
  @block = block
end

Instance Method Details

#call(request) ⇒ Object



24
25
26
# File 'lib/async/websocket/server.rb', line 24

def call(request)
  Async::WebSocket::Adapters::HTTP.open(request, **@options, &@block) or super
end