Class: Riddl::Utils::Notifications::Producer::WS

Inherits:
WebSocketImplementation show all
Defined in:
lib/ruby/riddl/utils/notifications_producer.rb

Overview

}}}

Instance Method Summary collapse

Methods inherited from WebSocketImplementation

#close, #closed?, #initialize, #io, #io=, #onerror, #send

Constructor Details

This class inherits a constructor from Riddl::WebSocketImplementation

Instance Method Details

#oncloseObject



319
320
321
# File 'lib/ruby/riddl/utils/notifications_producer.rb', line 319

def onclose
  @handler.key(@key).ws_close() unless @handler.nil?
end

#onmessage(data) ⇒ Object



315
316
317
# File 'lib/ruby/riddl/utils/notifications_producer.rb', line 315

def onmessage(data)
  @handler.key(@key).ws_message(data) unless @handler.nil?
end

#onopenObject

{{{



308
309
310
311
312
313
# File 'lib/ruby/riddl/utils/notifications_producer.rb', line 308

def onopen
  @backend = @a[0]
  @handler = @a[1]
  @key     = @r[-2]
  @handler.key(@key).ws_open(self) unless @handler.nil?
end