Class: Rpush::Daemon::Apns::Delivery
- Defined in:
- lib/rpush/daemon/apns/delivery.rb
Instance Method Summary collapse
-
#initialize(app, connection, batch) ⇒ Delivery
constructor
A new instance of Delivery.
- #perform ⇒ Object
Methods inherited from Delivery
#mark_batch_delivered, #mark_batch_failed, #mark_delivered, #mark_failed, #mark_retryable, #mark_retryable_exponential
Methods included from Loggable
#log_error, #log_info, #log_warn
Methods included from Reflectable
Constructor Details
#initialize(app, connection, batch) ⇒ Delivery
Returns a new instance of Delivery.
5 6 7 8 9 |
# File 'lib/rpush/daemon/apns/delivery.rb', line 5 def initialize(app, connection, batch) @app = app @connection = connection @batch = batch end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rpush/daemon/apns/delivery.rb', line 11 def perform @connection.write(batch_to_binary) mark_batch_delivered describe_deliveries rescue StandardError => error mark_batch_failed(error) raise ensure @batch.all_processed end |