Sha256: 52c6c768c4d07f6823606b6c856539dc10650d8dd62a3b0d2037a9796de82564

Contents?: true

Size: 552 Bytes

Versions: 31

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  class ThreadPool
    class Job
      attr_reader :error, :interval

      def initialize(interval = 0)
        @interval = interval
      end

      def perform!
        raise "`#{self.class.name}#perform!' must be defined"
      end

      def call
        perform!
      rescue StandardError => error
        @error = error
      end

      def success?
        !@error
      end

      def error?
        !!@error
      end

      def recurring?
        !interval.zero?
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.35.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.34.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.33.1 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.33.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.32.1 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.32.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.31.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.30.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.29.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.28.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.27.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.26.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.25.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.24.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.23.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.22.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.21.0 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.20.1 lib/shopify_cli/thread_pool/job.rb
shopify-cli-2.20.0 lib/shopify_cli/thread_pool/job.rb