class Rpush::Daemon::Dispatcher::Apnsp8Http2
Constants
- DEFAULT_TIMEOUT
- URLS
Public Class Methods
new(app, delivery_class, _options = {})
click to toggle source
# File lib/rpush/daemon/dispatcher/apnsp8_http2.rb, line 13 def initialize(app, delivery_class, _options = {}) @app = app @delivery_class = delivery_class url = URLS[app.environment.to_sym] @client = NetHttp2::Client.new(url, connect_timeout: DEFAULT_TIMEOUT) @token_provider = Rpush::Daemon::Apnsp8::Token.new(@app) end
Public Instance Methods
cleanup()
click to toggle source
# File lib/rpush/daemon/dispatcher/apnsp8_http2.rb, line 27 def cleanup @client.close end
dispatch(payload)
click to toggle source
# File lib/rpush/daemon/dispatcher/apnsp8_http2.rb, line 22 def dispatch(payload) @delivery_class.new(@app, @client, @token_provider, payload.batch).perform end