Class: Rapns::Daemon::Gcm::DeliveryHandler

Inherits:
DeliveryHandler show all
Defined in:
lib/rapns/daemon/gcm/delivery_handler.rb

Instance Attribute Summary

Attributes inherited from DeliveryHandler

#queue

Instance Method Summary collapse

Methods inherited from DeliveryHandler

#start, #stop

Methods included from Reflectable

#reflect

Constructor Details

#initialize(app) ⇒ DeliveryHandler

Returns a new instance of DeliveryHandler.



5
6
7
8
# File 'lib/rapns/daemon/gcm/delivery_handler.rb', line 5

def initialize(app)
  @app = app
  @http = Net::HTTP::Persistent.new('rapns')
end

Instance Method Details

#deliver(notification) ⇒ Object



10
11
12
# File 'lib/rapns/daemon/gcm/delivery_handler.rb', line 10

def deliver(notification)
  Rapns::Daemon::Gcm::Delivery.perform(@app, @http, notification)
end

#stoppedObject



14
15
16
# File 'lib/rapns/daemon/gcm/delivery_handler.rb', line 14

def stopped
  @http.shutdown
end