Sha256: 95f6e85eb17dce1411db57e40e51686bd48d3e8f14c488d5d0265b215f821bc0

Contents?: true

Size: 704 Bytes

Versions: 8

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2020-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

module Burner
  module Library
    # Arbitrarily put thread to sleep for X number of seconds
    #
    # Note: this does not use Payload#registers.
    class Sleep < Job
      attr_reader :seconds

      def initialize(name: '', seconds: 0)
        super(name: name)

        @seconds = seconds.to_f

        freeze
      end

      def perform(output, _payload)
        output.detail("Going to sleep for #{seconds} second(s)")

        Kernel.sleep(seconds)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
burner-1.12.0 lib/burner/library/sleep.rb
burner-1.11.0 lib/burner/library/sleep.rb
burner-1.10.0 lib/burner/library/sleep.rb
burner-1.9.0 lib/burner/library/sleep.rb
burner-1.9.0.pre.alpha lib/burner/library/sleep.rb
burner-1.8.0 lib/burner/library/sleep.rb
burner-1.7.0 lib/burner/library/sleep.rb
burner-1.7.0.pre.alpha lib/burner/library/sleep.rb