Class: Magent::WebSocketChannel

Inherits:
GenericChannel show all
Defined in:
lib/magent/web_socket_channel.rb

Instance Attribute Summary

Attributes inherited from GenericChannel

#name

Class Method Summary collapse

Methods inherited from GenericChannel

#collection, #dequeue, #enqueue, #initialize, #message_count, #next_message, #queue_count

Methods included from Failure

#enqueue_error, #error_collection, #error_count, #errors, #failed, #remove_error, #retry_error

Constructor Details

This class inherits a constructor from Magent::GenericChannel

Class Method Details

.dequeueObject



8
9
10
# File 'lib/magent/web_socket_channel.rb', line 8

def self.dequeue
  self.instance.dequeue
end

.instanceObject



12
13
14
# File 'lib/magent/web_socket_channel.rb', line 12

def self.instance
  @channel ||= self.new(Magent.config["websocket_channel"]||"magent.websocket")
end

.push(message) ⇒ Object



3
4
5
6
# File 'lib/magent/web_socket_channel.rb', line 3

def self.push(message)
  self.instance.enqueue(message)
  self.instance
end