Sha256: d95c5164795680c1c36d92fa3b2efe0d00a528930b38b8fe68981df6309a970f
Contents?: true
Size: 889 Bytes
Versions: 32
Compression:
Stored size: 889 Bytes
Contents
# Acts the same as the Channel class on the front-end, but calls # directly instead of using sockjs. require 'volt/reactive/events' require 'volt/tasks/dispatcher' # Behaves the same as the Channel class, only the Channel class uses # sockjs to pass messages to the backend. ChannelStub, simply passes # them directly to SocketConnectionHandlerStub. class ChannelStub include ReactiveTags attr_reader :state, :error, :reconnect_interval def initiailze @state = :connected end def opened trigger!('open') trigger!('changed') end def message_received(*message) trigger!('message', nil, *message) end tag_method(:send_message) do destructive! end def send_message(message) SocketConnectionHandlerStub.new(self).process_message(message) end def close! raise "close! should not be called on the backend channel" end end
Version data entries
32 entries across 32 versions & 1 rubygems