Sha256: 01eca5fb56aa11d082723019aefb00b091c53b3bebc8498637b02d42651c84b4

Contents?: true

Size: 618 Bytes

Versions: 11

Compression:

Stored size: 618 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Processing
    # A simple object that allows us to keep track of processing state.
    # It allows to indicate if given thing moved from success to a failure or the other way around
    # Useful for tracking consumption state
    class Result
      def initialize
        @success = true
      end

      # @return [Boolean]
      def success?
        @success
      end

      # Marks state as successful
      def success!
        @success = true
      end

      # Marks state as failure
      def failure!
        @success = false
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
karafka-2.0.3 lib/karafka/processing/result.rb
karafka-2.0.2 lib/karafka/processing/result.rb
karafka-2.0.1 lib/karafka/processing/result.rb
karafka-2.0.0 lib/karafka/processing/result.rb
karafka-2.0.0.rc6 lib/karafka/processing/result.rb
karafka-2.0.0.rc5 lib/karafka/processing/result.rb
karafka-2.0.0.rc4 lib/karafka/processing/result.rb
karafka-2.0.0.rc3 lib/karafka/processing/result.rb
karafka-2.0.0.rc2 lib/karafka/processing/result.rb
karafka-2.0.0.rc1 lib/karafka/processing/result.rb
karafka-2.0.0.beta5 lib/karafka/processing/result.rb