def queue_request(kind, type, payload, target, token, expires_at, skewed_by, &callback)
      request = {:kind => kind, :type => type, :payload => payload, :target => target,
                 :token => token, :expires_at => expires_at, :skewed_by => skewed_by,
                 :callback => callback}
      Log.info("[offline] Queuing request: #{request.inspect}")
      vote_to_restart if (@restart_vote_count += 1) >= MAX_QUEUED_REQUESTS
      if @state == :initializing
        # We are in the initialization callback, requests should be put at the head of the queue
        @queue.unshift(request)
      else
        @queue << request
      end
      true
    end
def queue_request(kind, type, payload, target, token, expires_at, skewed_by, &callback)
      request = {:kind => kind, :type => type, :payload => payload, :target => target,
                 :token => token, :expires_at => expires_at, :skewed_by => skewed_by,
                 :callback => callback}
      Log.info("[offline] Queuing request: #{request.inspect}")
      vote_to_restart if (@restart_vote_count += 1) >= MAX_QUEUED_REQUESTS
      if @state == :initializing
        # We are in the initialization callback, requests should be put at the head of the queue
        @queue.unshift(request)
      else
        @queue << request
      end
      true
    end
Queue given request in memory

 === Parameters
 kind(Symbol):: Kind of request: :send_push or :send_request
 type(String):: Dispatch route for the request; typically identifies actor and action
 payload(Object):: Data to be sent with marshalling en route
 target(Hash|NilClass):: Target for request
 token(String):: Token uniquely identifying request
 expires_at(Integer):: Time in seconds in Unix-epoch when this request expires and
   is to be ignored by the receiver; value 0 means never expire
 skewed_by(Integer):: Amount of skew already applied to expires_at in seconds

 === Block
 Optional block used to process response asynchronously with the following parameter:
   result(Result):: Response with an OperationResult of SUCCESS, RETRY, NON_DELIVERY, or ERROR

 === Return
 true:: Always return true