Async is compatible with a wide range of different Ruby versions.
stable-v1 branch of async is compatible with Ruby 2.5+ & TruffleRuby, and partially compatible with JRuby.
Because it was designed with the interfaces available in Ruby 2.x, the following limitations apply:
class Async::Taskimplements context switching using
Fiber.resume. This means that
module Asyncmay not be compatible with code which uses fibers for flow control, e.g.
class Async::Reactoris unable to intercept blocking operations with native interfaces. You need to use the wrappers provided by
- DNS resolution is blocking.
main branch of async is compatible with Ruby 3.0.2+, and partially compatible with TruffleRuby. JRuby is currently incompatble.
Fiber#transferfor scheduling so it is compatible with all other usage of Fiber.
class Async::Reactorimplements the Fiber scheduler interface and is compatible with a wide range of non-blocking operations, including DNS,
- External C libraries that use blocking operations may still block.
- Ruby <= 3.0.2 has some bugs in its non-blocking thread primitives. These should be fixed in 3.0.3+.