Sha256: 6f00d7bb14e5f65924927457b26569785743ad5c405c1ff4783d40a7ba49f959
Contents?: true
Size: 880 Bytes
Versions: 23
Compression:
Stored size: 880 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
23 entries across 23 versions & 1 rubygems