class WampRails::Command::BaseCommand

Attributes

client[RW]
queue[RW]

Public Class Methods

new(client) click to toggle source
# File lib/wamp_rails/commands/base_command.rb, line 16
def initialize(client)
  self.queue = Queue.new
  self.client = client
end

Public Instance Methods

callback(result, error, details) click to toggle source

Used in sub-classes to handle the response

# File lib/wamp_rails/commands/base_command.rb, line 33
def callback(result, error, details)
  self.queue.push(CallbackArgs.new(result, error, details))
end
execute() click to toggle source

Executes the command. This is called by the library in the EM Thread

# File lib/wamp_rails/commands/base_command.rb, line 28
def execute
  # Override when sub classing
end
session() click to toggle source

Returns the session from the client

# File lib/wamp_rails/commands/base_command.rb, line 22
def session
  self.client.wamp.session
end