lib/push0r/Queue.rb
# Flushes the queue by transmitting the enqueued messages using the registered services
# @return [FlushResult] the result of the operation
Flushes the queue by transmitting the enqueued messages using the registered services
Flushes the queue by transmitting the enqueued messages using the registered services
def flush
      failed_messages = []
      new_token_messages = []
      @queued_messages.each do |service, messages|
        service.init_push
        messages.each do |message|
          service.send(message)
        end
        (failed, new_token) = service.end_push
        failed_messages += failed
        new_token_messages += new_token
      end
      @queued_messages = {}
      return FlushResult.new(failed_messages, new_token_messages)
    end
def flush failed_messages = [ ] new_token_messages = [ ] @queued_messages . each do | service , messages | service . init_push messages . each do | message | service . send ( message ) end ( failed , new_token ) = service . end_push failed_messages += failed new_token_messages += new_token end @queued_messages = { } return FlushResult . new ( failed_messages , new_token_messages ) end
Flushes the queue by transmitting the enqueued messages using the registered services
Flushes the queue by transmitting the enqueued messages using the registered services
the result of the operation
the result of the operation
FlushResult