Class: Rpush::Daemon::Dispatcher::Apnsp8Http2
- Inherits:
-
Object
- Object
- Rpush::Daemon::Dispatcher::Apnsp8Http2
show all
- Includes:
- Loggable, Reflectable
- Defined in:
- lib/rpush/daemon/dispatcher/apnsp8_http2.rb
Constant Summary
collapse
- URLS =
{
production: 'https://api.push.apple.com',
development: 'https://api.sandbox.push.apple.com',
sandbox: 'https://api.sandbox.push.apple.com'
}
- DEFAULT_TIMEOUT =
60
Instance Method Summary
collapse
#reflect
Methods included from Loggable
#log_debug, #log_error, #log_info, #log_warn
Constructor Details
#initialize(app, delivery_class, _options = {}) ⇒ Apnsp8Http2
16
17
18
19
20
21
22
|
# File 'lib/rpush/daemon/dispatcher/apnsp8_http2.rb', line 16
def initialize(app, delivery_class, _options = {})
@app = app
@delivery_class = delivery_class
@client = create_http2_client(app)
@token_provider = Rpush::Daemon::Apnsp8::Token.new(@app)
end
|
Instance Method Details
#cleanup ⇒ Object
28
29
30
|
# File 'lib/rpush/daemon/dispatcher/apnsp8_http2.rb', line 28
def cleanup
@client.close
end
|
#dispatch(payload) ⇒ Object
24
25
26
|
# File 'lib/rpush/daemon/dispatcher/apnsp8_http2.rb', line 24
def dispatch(payload)
@delivery_class.new(@app, @client, @token_provider, payload.batch).perform
end
|