class Async::Idler
def async(*arguments, parent: (@parent or Task.current), **options, &block)
@parameter options [Hash] The options to pass to the task.
@parameter parent [Interface(:async) | Nil] The parent task to use for async operations.
@parameter arguments [Array] The arguments to pass to the block.
@asynchronous Executes the given block concurrently.
Wait until the system is idle, then execute the given block in a new task.
def async(*arguments, parent: (@parent or Task.current), **options, &block) wait # It is crucial that we optimistically execute the child task, so that we prevent a tight loop invoking this method from consuming all available resources. parent.async(*arguments, **options, &block) end