Sha256: 6436a188644917b34d104dabe1796dca9bd5ce857c2425f6b66dfbfc70e3a7d8

Contents?: true

Size: 718 Bytes

Versions: 3

Compression:

Stored size: 718 Bytes

Contents

=begin

    This file is part of the Raktr project and may be subject to
    redistribution and commercial restrictions. Please see the Raktr
    web site for more information on licensing and terms of use.

=end

class Raktr
class Tasks

# @note {#interval Time} accuracy cannot be guaranteed.
#
# {Base Task} occurring after {#interval} seconds.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
class Delayed < Periodic

    # @note Will call {#done} right after.
    #
    # @return   [Object, nil]
    #   Return value of the configured task or `nil` if it's not
    #   {#interval time} yet.
    def call( *args )
        return if !call?

        call_task( *args ).tap { done }
    end

end

end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
raktr-0.0.3 lib/raktr/tasks/delayed.rb
raktr-0.0.2 lib/raktr/tasks/delayed.rb
raktr-0.0.1 lib/raktr/tasks/delayed.rb