def _queue_command(command, callback=nil)

      # If the current thread is the EM thread, execute the command.  Else put it in the queue
      if self.thread == Thread.current
        self._execute_command(command)
      else
        self.cmd_queue.push(command)
      end

      # If the callback is defined, block until it finishes
      if callback
        callback_args = command.queue.pop
        callback.call(callback_args.result, callback_args.error, callback_args.details)
      end
    end
def _queue_command(command, callback=nil)

      # If the current thread is the EM thread, execute the command.  Else put it in the queue
      if self.thread == Thread.current
        self._execute_command(command)
      else
        self.cmd_queue.push(command)
      end

      # If the callback is defined, block until it finishes
      if callback
        callback_args = command.queue.pop
        callback.call(callback_args.result, callback_args.error, callback_args.details)
      end
    end
endregion
region Private Methods
 Queues the command and blocks it the callback is not nil
 @param [WampRails::Command::Base] - The command to queue
 @param [Block] - The block to call when complete