class Rake::Promise

Attributes

invocation_chain[RW]
parent[R]

Public Class Methods

new(args, &block) click to toggle source

Create a promise to do the chore specified by the block. Overrides by adding @parent

# File lib/rake/opt/current_invocation_chain/patches/rake/promise.rb, line 7
def initialize(args, &block)
  @mutex = Mutex.new
  @result = NOT_SET
  @error = NOT_SET
  @args = args
  @block = block
  @invocation_chain = nil
  @parent = Thread.current.promise
end

Public Instance Methods

__chore__(*args, &block)
Alias for: chore
chore(*args, &block) click to toggle source

Properly set the parent thread

# File lib/rake/opt/current_invocation_chain/patches/rake/promise.rb, line 20
def chore(*args, &block)
  old_promise = Thread.current.promise
  Thread.current.promise = self
  __chore__(*args, &block)
  Thread.current.promise = old_promise
end
Also aliased as: __chore__