Class: Rapns::Daemon::Apns::DeliveryHandler
Constant Summary
collapse
- HOSTS =
{
:production => ['gateway.push.apple.com', 2195],
:development => ['gateway.sandbox.push.apple.com', 2195], :sandbox => ['gateway.sandbox.push.apple.com', 2195]
}
DeliveryHandler::WAKEUP
Instance Attribute Summary
#queue
Instance Method Summary
collapse
#start, #stop, #wait, #wakeup
#reflect
Constructor Details
Returns a new instance of DeliveryHandler.
11
12
13
14
|
# File 'lib/rapns/daemon/apns/delivery_handler.rb', line 11
def initialize(app)
@app = app
@host, @port = HOSTS[@app.environment.to_sym]
end
|
Instance Method Details
#deliver(notification, batch) ⇒ Object
16
17
18
|
# File 'lib/rapns/daemon/apns/delivery_handler.rb', line 16
def deliver(notification, batch)
Rapns::Daemon::Apns::Delivery.new(@app, connection, notification, batch).perform
end
|
#stopped ⇒ Object
20
21
22
|
# File 'lib/rapns/daemon/apns/delivery_handler.rb', line 20
def stopped
@connection.close if @connection
end
|