Sha256: 2a901c78af55d57e7d8b71f6ea3f522e5991917bce72861ac1f599b5f07d84eb

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

module APN
  module Backend

    class Sidekiq

      def notify(token, opts)
        ::Sidekiq::Client.enqueue(APN::Jobs::SidekiqNotificationJob, token, opts)
      end
    end

    class Resque

      def notify(token, opts)
        ::Resque.enqueue(APN::Jobs::ResqueNotificationJob, token, opts)
      end
    end

    class Simple

      def notify(token, opts)
        Thread.new do
          APN.notify_sync(token, opts)
        end
      end
    end

    class Null

      def notify(token, opts)
        APN.log("Null Backend sending message to #{token}")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
apn_sender-2.0.1 lib/apn/backend.rb
apn_sender-2.0.0 lib/apn/backend.rb