Method: Async::Scheduler#async

Defined in:
lib/async/scheduler.rb

#async(*arguments, **options, &block) ⇒ Object

Deprecated.

Use #run or Task#async instead.

Start an asynchronous task within the specified reactor. The task will be executed until the first blocking call, at which point it will yield and and this method will return.



588
589
590
591
592
593
594
595
596
597
598
599
# File 'lib/async/scheduler.rb', line 588

def async(*arguments, **options, &block)
  # Since this method is called by `run`, this warning is too excessive:
  # warn("Async::Scheduler#async is deprecated. Use `run` or `Task#async` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
  
  Kernel.raise ClosedError if @selector.nil?
  
  task = Task.new(Task.current? || self, **options, &block)
  
  task.run(*arguments)
  
  return task
end