Sha256: 67d9825e197d38de32cef1271ad97baf7aaaa4847795aa42c72dc6ab68de18aa

Contents?: true

Size: 1.17 KB

Versions: 70

Compression:

Stored size: 1.17 KB

Contents

module ActionSubscriber
  class Base
    extend ::ActionSubscriber::DefaultRouting
    extend ::ActionSubscriber::DSL
    extend ::ActionSubscriber::Subscribable

    ##
    # Private Attributes
    #
    private

    attr_reader :env, :payload, :raw_payload

    public

    ##
    # Constructor
    #
    def initialize(env)
      @env = env
      @payload = env.payload
      @raw_payload = env.encoded_payload
    end

    ##
    # Class Methods
    #

    # Inherited callback, save a reference to our descendents
    #
    def self.inherited(klass)
      super

      inherited_classes << klass
    end

    # Storage for any classes that inherited from us
    #
    def self.inherited_classes
      @_inherited_classes ||= []
    end

    ##
    # Class Aliases
    #
    class << self
      alias_method :subscribers, :inherited_classes
    end

    ##
    # Private Instance Methods
    #
    private

    def acknowledge
      env.acknowledge
    end

    def reject
      env.reject
    end

    def redeliver(backoff_schedule = ::ActionSubscriber::MessageRetry::SCHEDULE)
      ::ActionSubscriber::MessageRetry::redeliver_message_with_backoff(env, backoff_schedule)
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
action_subscriber-5.3.3-java lib/action_subscriber/base.rb
action_subscriber-5.3.3 lib/action_subscriber/base.rb
action_subscriber-5.3.2-java lib/action_subscriber/base.rb
action_subscriber-5.3.2 lib/action_subscriber/base.rb
action_subscriber-5.3.1-java lib/action_subscriber/base.rb
action_subscriber-5.3.1 lib/action_subscriber/base.rb
action_subscriber-5.3.1.pre-java lib/action_subscriber/base.rb
action_subscriber-5.3.1.pre lib/action_subscriber/base.rb
action_subscriber-5.3.0-java lib/action_subscriber/base.rb
action_subscriber-5.3.0 lib/action_subscriber/base.rb
action_subscriber-5.2.4-java lib/action_subscriber/base.rb
action_subscriber-5.2.4 lib/action_subscriber/base.rb
action_subscriber-5.2.3-java lib/action_subscriber/base.rb
action_subscriber-5.2.3 lib/action_subscriber/base.rb
action_subscriber-5.2.2-java lib/action_subscriber/base.rb
action_subscriber-5.2.2 lib/action_subscriber/base.rb
action_subscriber-5.2.1-java lib/action_subscriber/base.rb
action_subscriber-5.2.1 lib/action_subscriber/base.rb
action_subscriber-5.2.0-java lib/action_subscriber/base.rb
action_subscriber-5.2.0 lib/action_subscriber/base.rb