lib/async/task.rb in async-1.23.0 vs lib/async/task.rb in async-1.24.0

- old
+ new

@@ -110,23 +110,24 @@ # @attr status [Symbol] The status of the execution of the fiber, one of `:initialized`, `:running`, `:complete`, `:stopped` or `:failed`. attr :status # Begin the execution of the task. - def run(*args) + def run(*arguments) if @status == :initialized @status = :running - @fiber.resume(*args) + + @fiber.resume(*arguments) else raise RuntimeError, "Task already running!" end end - def async(*args, **options, &block) + def async(*arguments, **options, &block) task = Task.new(@reactor, self, **options, &block) - task.run(*args) + task.run(*arguments) return task end # Retrieve the current result of the task. Will cause the caller to wait until result is available. @@ -246,14 +247,14 @@ child.stop(true) end end def make_fiber(&block) - Fiber.new do |*args| + Fiber.new do |*arguments| set! begin - @result = yield(self, *args) + @result = yield(self, *arguments) @status = :complete # logger.debug(self) {"Task was completed with #{@children.size} children!"} rescue Stop stop! rescue StandardError => error