Path to this page: ./
devel/ruby-async,
Concurrency framework for Ruby
Branch: CURRENT,
Version: 2.37.0,
Package name: ruby33-async-2.37.0,
Maintainer: pkgsrc-usersAsync
Async is a composable asynchronous I/O framework for Ruby based on io-event
and timers.
"Lately I've been looking into async, as one of my projects -
tus-ruby-server - would really benefit from non-blocking I/O.
It's really beautifully designed." - janko
Features
* Scalable event-driven I/O for Ruby. Thousands of clients per process!
* Light weight fiber-based concurrency. No need for callbacks!
* Multi-thread/process containers for parallelism.
* Growing eco-system of event-driven components.
Master sites:
Filesize: 64 KB
Version history: (Expand)
- (2026-03-09) Updated to version: ruby33-async-2.37.0
- (2026-03-08) Updated to version: ruby33-async-2.38.0
- (2026-01-25) Updated to version: ruby32-async-2.36.0
- (2026-01-17) Updated to version: ruby32-async-2.35.3
- (2026-01-13) Updated to version: ruby32-async-2.35.2
- (2025-10-27) Updated to version: ruby32-async-2.34.0
CVS history: (Expand)
| 2026-03-09 08:11:14 by Takahiro Kambe | Files touched by this commit (3) |
Log message: devel/ruby-async: downgrade to 2.37.0 Version 2.38.0 silently increase minimum version of Ruby to 3.3. At this time, downgrading to 2.37.0 which supports Ruby 3.2. |
2026-03-08 14:56:59 by Takahiro Kambe | Files touched by this commit (3) |  |
Log message: devel/ruby-async: update to 2.38.0 2.37.0 (2026-03-08) * Introduce Async::Loop for robust, time-aligned loops. * Add support for Async::Promise#wait(timeout: N). 2.38.0 (2026-03-08) * Rename Task#stop to Task#cancel for better clarity and consistency with common concurrency terminology. The old stop method is still available as an alias for backward compatibility, but it is recommended to use cancel going forward. * Forward arguments from Task#wait -> Promise#wait, so task.wait(timeout: N) is supported. |
2026-01-25 15:01:22 by Takahiro Kambe | Files touched by this commit (3) |  |
Log message: devel/ruby-async: update to 2.36.0 2.36.0 (2026-01-22) * Better class Task documentation. * Introduce Task.wait_all. (#441) * Introduce Task#join alias. |
2026-01-17 16:41:05 by Takahiro Kambe | Files touched by this commit (2) |  |
Log message: devel/ruby-async: update to 2.35.3 2.35.3 (2026-01-15) * Add Clock#as_json and Clock#to_json. |
2026-01-13 16:28:14 by Takahiro Kambe | Files touched by this commit (3) |  |
Log message: devel/ruby-async: update to 2.35.2 2.35.0 (2025-11-30) * Process.fork is now properly handled by the Async fiber scheduler, ensuring that the scheduler state is correctly reset in the child process after a fork. This prevents issues where the child process inherits the scheduler state from the parent, which could lead to unexpected behavior. 2.35.1 (2026-01-02) * Fix incorrect handling of spurious wakeups in Async::Promise#wait, which could lead to premature (incorrect) resolution of the promise. 2.35.2 (2026-01-11) * Improved handling of Process.fork on Ruby 4+. * Improve @promise state handling in Task#initialize, preventing incomplete instances being visible to the scheduler. |
2025-10-27 15:53:24 by Takahiro Kambe | Files touched by this commit (3) |  |
Log message: devel/ruby-async: update to 2.34.0 2.33.0 (2025-09-29) * Introduce Async::Promise.fulfill for optional promise resolution. 2.34.0 (2025-10-08) Kernel::Barrier Convenience Interface Starting multiple concurrent tasks and waiting for them to finish is a common pattern. This change introduces a small ergonomic helper, Barrier, defined in Kernel, that encapsulates this behavior: it creates an Async::Barrier, yields it to a block, waits for completion (using Sync to run a reactor if needed), and ensures remaining tasks are stopped on exit. require 'async' Barrier do |barrier| 3.times do |i| barrier.async do |task| sleep(rand * 0.1) # Simulate work puts "Task #{i} completed" end end end # All tasks are guaranteed to complete or be stopped when the block exits. If an exception is raised by a task, it will be propagated to the caller, and any remaining tasks will be stopped. The parent: parameter can be used to specify a parent task for the barrier, otherwise it will use the current task if available, or create a new reactor if not. |
2025-09-15 17:11:35 by Takahiro Kambe | Files touched by this commit (3) |  |
Log message: devel/ruby-async: update to 2.32.0 2.29.0 (2025-09-04) This release introduces thread-safety as a core concept of Async. Many core classes now have thread-safe guarantees, allowing them to be used safely across multiple threads. * Thread-safe Async::Condition and Async::Notification, implemented using Thread::Queue. * Thread-safe Async::Queue and Async::LimitedQueue, implemented using Thread::Queue and Thread::LimitedQueue respectively. * Async::Variable is deprecated in favor of Async::Promise. Introduce Async::Promise This release introduces the new Async::Promise class and refactors Async::Task to use promises for state management internally. This architectural improvement achieves the design goal that "a task should be a promise with attached computation and cancellation handling." * Thread-safe promise implementation with immutable state transitions. * Consistent state management using symbols: :completed, :failed, :cancelled. * Promise cancellation with cancel() method and Cancel exception class. * Comprehensive test coverage with 47 new test cases covering all edge cases. require 'async/promise' # Basic promise usage - works independently of Async framework promise = Async::Promise.new # In another thread or fiber, resolve the promise Thread.new do sleep(1) # Simulate some work promise.resolve("Hello, World!") end # Wait for the result result = promise.wait puts result # => "Hello, World!" # Check promise state puts promise.resolved? # => true puts promise.completed? # => true Promises bridge Thread and Fiber concurrency models - a promise resolved in one thread can be awaited in a fiber, and vice versa. Introduce Async::PriorityQueue The new Async::PriorityQueue provides a thread-safe, fiber-aware queue where consumers can specify priority levels. Higher priority consumers are served first when items become available, with FIFO ordering maintained for equal priorities. This is useful for implementing priority-based task processing systems where critical operations need to be handled before lower priority work. require 'async' require 'async/priority_queue' Async do queue = Async::PriorityQueue.new # Start consumers with different priorities low_priority = async do puts "Low priority consumer got: #{queue.dequeue(priority: 1)}" end medium_priority = async do puts "Medium priority consumer got: #{queue.dequeue(priority: 5)}" end high_priority = async do puts "High priority consumer got: #{queue.dequeue(priority: 10)}" end # Add items to the queue queue.push("first item") queue.push("second item") queue.push("third item") # Output: # High priority consumer got: first item # Medium priority consumer got: second item # Low priority consumer got: third item end 2.29.1 (2025-09-05) * Better handling of waiter invalidation in PriorityQueue. (#419) 2.30.0 (2025-09-08) * Add timeout support to Async::Queue#dequeue and Async::Queue#pop methods. * Add timeout support to Async::PriorityQueue#dequeue and Async::PriorityQueue#pop methods. * Add closed? method to Async::PriorityQueue for full queue interface compatibility. * Support non-blocking operations using timeout: 0 parameter. 2.31.0 (2025-09-08) * Introduce Async::Deadline for precise timeout management in compound operations. 2.32.0 (2025-09-11) * Introduce Queue#waiting_count and PriorityQueue#waiting_count. Generally for statistics/testing purposes only. |
2025-09-01 15:22:31 by Takahiro Kambe | Files touched by this commit (2) |  |
Log message: devel/ruby-async: update to 2.28.1 2.28.1 (2025-09-01) * Fix race condition between Async::Barrier#stop and finish signalling. |