From a0737d8e435150cdf6a93c25ddd891228e67e526 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Fri, 8 Nov 2024 14:28:19 +1300 Subject: [PATCH] Bump minor version. --- lib/async/version.rb | 2 +- readme.md | 5 +++++ releases.md | 48 ++++++++++++++++++++------------------------ 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/async/version.rb b/lib/async/version.rb index dbc6d92b..cfdb0d33 100644 --- a/lib/async/version.rb +++ b/lib/async/version.rb @@ -4,5 +4,5 @@ # Copyright, 2017-2024, by Samuel Williams. module Async - VERSION = "2.18.0" + VERSION = "2.19.0" end diff --git a/readme.md b/readme.md index e8be4a01..71eaa625 100644 --- a/readme.md +++ b/readme.md @@ -35,6 +35,11 @@ Please see the [project documentation](https://socketry.github.io/async/) for mo Please see the [project releases](https://socketry.github.io/async/releases/index) for all releases. +### v2.19.0 + + - [Async::Scheduler Debugging](https://socketry.github.io/async/releases/index#async::scheduler-debugging) + - [Console Shims](https://socketry.github.io/async/releases/index#console-shims) + ### v2.18.0 - Add support for `Sync(annotation:)`, so that you can annotate the block with a description of what it does, even if it doesn't create a new task. diff --git a/releases.md b/releases.md index 335d4153..34999f85 100644 --- a/releases.md +++ b/releases.md @@ -1,28 +1,26 @@ # Releases -## Unreleased +## v2.19.0 ### Async::Scheduler Debugging Occasionally on issues, I encounter people asking for help and I need more information. Pressing Ctrl-C to exit a hung program is common, but it usually doesn't provide enough information to diagnose the problem. Setting the `CONSOLE_LEVEL=debug` environment variable will now print additional information about the scheduler when you interrupt it, including a backtrace of the current tasks. -``` -> CONSOLE_LEVEL=debug bundle exec ruby ./test.rb -^C 0.0s debug: Async::Reactor [oid=0x974] [ec=0x988] [pid=9116] [2024-11-08 14:12:03 +1300] - | Scheduler interrupted: Interrupt - | # - | # - | → /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `transfer' - | /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `block' - | /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:207:in `kernel_sleep' - | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleep' - | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleepy' - | /Users/samuel/Developer/socketry/async/test.rb:12:in `block in ' - | /Users/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' - | /Users/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in schedule' -/Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:317:in `select': Interrupt -... (backtrace continues) ... -``` + > CONSOLE_LEVEL=debug bundle exec ruby ./test.rb + ^C 0.0s debug: Async::Reactor [oid=0x974] [ec=0x988] [pid=9116] [2024-11-08 14:12:03 +1300] + | Scheduler interrupted: Interrupt + | # + | # + | → /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `transfer' + | /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:185:in `block' + | /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:207:in `kernel_sleep' + | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleep' + | /Users/samuel/Developer/socketry/async/test.rb:7:in `sleepy' + | /Users/samuel/Developer/socketry/async/test.rb:12:in `block in ' + | /Users/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' + | /Users/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in schedule' + /Users/samuel/Developer/socketry/async/lib/async/scheduler.rb:317:in `select': Interrupt + ... (backtrace continues) ... This gives better visibility into what the scheduler is doing, and should help diagnose issues. @@ -30,7 +28,7 @@ This gives better visibility into what the scheduler is doing, and should help d The `async` gem depends on `console` gem, because my goal was to have good logging by default without thinking about it too much. However, some users prefer to avoid using the `console` gem for logging, so I've added an experimental set of shims which should allow you to bypass the `console` gem entirely. -```ruby +``` ruby require 'async/console' require 'async' @@ -39,13 +37,11 @@ Async{raise "Boom"} Will now use `Kernel#warn` to print the task failure warning: -``` -# -Task may have ended with unhandled exception. -(irb):4:in `block in ': Boom (RuntimeError) - from /home/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' - from /home/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in schedule' -``` + # + Task may have ended with unhandled exception. + (irb):4:in `block in ': Boom (RuntimeError) + from /home/samuel/Developer/socketry/async/lib/async/task.rb:197:in `block in run' + from /home/samuel/Developer/socketry/async/lib/async/task.rb:420:in `block in schedule' ## v2.18.0