Sha256: 5860487d2e9ed65a9f26d2f8aab2b2bfe1072a242435060363a97c938706e397

Contents?: true

Size: 555 Bytes

Versions: 2

Compression:

Stored size: 555 Bytes

Contents

module APN::Jobs
  # This is the class that's actually enqueued via Sidekiq when user calls +APN.notify+.
  # It gets added to the +apple_push_notifications+ Sidekiq queue, which should only be operated on by
  # workers of the +APN::Sender+ class.
  class SidekiqNotificationJob
    include Sidekiq::Worker
    # Behind the scenes, this is the name of our Sidekiq queue
    sidekiq_options :queue => QUEUE_NAME

    # Build a notification from arguments and send to Apple
    def perform(token, opts)
      APN.notify_sync(token, opts)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
apn_sender-2.1.1 lib/apn/jobs/sidekiq_notification_job.rb
apn_sender-2.1.0 lib/apn/jobs/sidekiq_notification_job.rb