Sha256: d5062b3d08bf45b8dcabf11d85ef91418dbcfc0e0ba7063fc7260751c0e4747a

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module QueueBus
  module Adapters
    class Base
      # adapters need to define the NonImplemented methods in this class

      def initialize
        enabled!
      end

      def enabled!
        # called the first time we know we are using this adapter
        # it would be a good spot to require the libraries you're using
        # and modify QueueBus::Worker as needed
        raise NotImplementedError
      end

      def redis
        # for now, we're always using redis as a storage mechanism so give us one
        raise NotImplementedError
      end

      def enqueue(_queue_name, _klass, _json)
        # enqueue the given class (Driver/Rider) in your queue
        raise NotImplementedError
      end

      def enqueue_at(_epoch_seconds, _queue_name, _klass, _json)
        # enqueue the given class (Publisher) in your queue to run at given time
        raise NotImplementedError
      end

      def setup_heartbeat!
        # if possible, tell a recurring job system to publish every minute
        raise NotImplementedError
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
queue-bus-0.13.3 lib/queue_bus/adapters/base.rb
queue-bus-0.13.2 lib/queue_bus/adapters/base.rb
queue-bus-0.13.1 lib/queue_bus/adapters/base.rb
queue-bus-0.13.0 lib/queue_bus/adapters/base.rb
queue-bus-0.12.0 lib/queue_bus/adapters/base.rb
queue-bus-0.11.0 lib/queue_bus/adapters/base.rb
queue-bus-0.10.0 lib/queue_bus/adapters/base.rb
queue-bus-0.9.1 lib/queue_bus/adapters/base.rb