Module: Nl::Async

Defined in:
nl/lib/nl/async.rb,
nl/lib/nl/async/driver.rb,
nl/lib/nl/async/mailbox.rb,
nl/lib/nl/async/operation.rb,
nl/lib/nl/async/dispatcher.rb

Overview

Asynchronous request handling support.

Defined Under Namespace

Modules: Drivers Classes: ConcurrentConsumptionError, Dispatcher, Future, Mailbox, Stream, StreamOverflowError, UnavailableError

Class Method Summary collapse

Class Method Details

.driver(name) ⇒ Object



28
29
30
31
32
33
34
35
# File 'nl/lib/nl/async/driver.rb', line 28

def self.driver(name)
  case name
  when :thread then Drivers::Thread.new
  when :fiber then Drivers::Fiber.new
  else
    raise ArgumentError, "unknown async executor: #{name.inspect}"
  end
end