Sha256: b982f26e1e241fe02aa67e35f994737678c68b356589baebd518fcb4f534ae72

Contents?: true

Size: 473 Bytes

Versions: 26

Compression:

Stored size: 473 Bytes

Contents

module Rpush
  module Daemon
    module Dispatcher
      class Http
        def initialize(app, delivery_class, _options = {})
          @app = app
          @delivery_class = delivery_class
          @http = Net::HTTP::Persistent.new('rpush')
        end

        def dispatch(payload)
          @delivery_class.new(@app, @http, payload.notification, payload.batch).perform
        end

        def cleanup
          @http.shutdown
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rpush-2.0.0-java lib/rpush/daemon/dispatcher/http.rb
rpush-2.0.0 lib/rpush/daemon/dispatcher/http.rb
rpush-2.0.0.rc1-java lib/rpush/daemon/dispatcher/http.rb
rpush-2.0.0.rc1 lib/rpush/daemon/dispatcher/http.rb
rpush-2.0.0.beta2 lib/rpush/daemon/dispatcher/http.rb
rpush-2.0.0.beta1 lib/rpush/daemon/dispatcher/http.rb