Sha256: ddb419c69117d9b60b459034a9e6c623c45ff312a1544a6b3341d3189deca245

Contents?: true

Size: 337 Bytes

Versions: 16

Compression:

Stored size: 337 Bytes

Contents

# typed: true

module Datadog
  module Core
    # Base class for work tasks
    class Worker
      attr_reader \
        :task

      def initialize(&block)
        @task = block
      end

      def perform(*args)
        task.call(*args) unless task.nil?
      end

      protected

      attr_writer \
        :task
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ddtrace-1.9.0 lib/datadog/core/worker.rb
ddtrace-1.8.0 lib/datadog/core/worker.rb
ddtrace-1.7.0 lib/datadog/core/worker.rb
ddtrace-1.6.1 lib/datadog/core/worker.rb
ddtrace-1.6.0 lib/datadog/core/worker.rb
ddtrace-1.5.2 lib/datadog/core/worker.rb
ddtrace-1.5.1 lib/datadog/core/worker.rb
ddtrace-1.5.0 lib/datadog/core/worker.rb
ddtrace-1.4.2 lib/datadog/core/worker.rb
ddtrace-1.4.1 lib/datadog/core/worker.rb
ddtrace-1.4.0 lib/datadog/core/worker.rb
ddtrace-1.3.0 lib/datadog/core/worker.rb
ddtrace-1.2.0 lib/datadog/core/worker.rb
ddtrace-1.1.0 lib/datadog/core/worker.rb
ddtrace-1.0.0 lib/datadog/core/worker.rb
ddtrace-1.0.0.beta2 lib/datadog/core/worker.rb