From: "ioquatix (Samuel Williams)" Date: 2022-11-01T01:09:40+00:00 Subject: [ruby-core:110562] [Ruby master Feature#19056] Introduce `Fiber.annotation` for attaching messages to fibers. Issue #19056 has been updated by ioquatix (Samuel Williams). I want to add annotations to default gems like `Net::HTTP` so it would need to be in core, or at least some kind of hook. If it's too much to have a specific implementation, we could just make a general annotation method and then hook it up with a callback to the fiber scheduler or something. Another use case: https://github.com/socketry/async/issues/78 ---------------------------------------- Feature #19056: Introduce `Fiber.annotation` for attaching messages to fibers. https://bugs.ruby-lang.org/issues/19056#change-99892 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal * Assignee: ioquatix (Samuel Williams) ---------------------------------------- It's useful to know what a fiber is doing especially when they have a temporal execution (i.e. sockets connecting vs connected, binding vs accepting, queue popping, etc) Let's introduce `Fiber.annotate` and `Fiber#annotation` for logging a short message attached to Fibers. ```ruby Fiber.annotate "Counting to 10" 10.times{|I| puts I} # Fiber.current.annotation => "Counting to 10" ``` Pull Request: https://github.com/ruby/ruby/pull/6554 ---Files-------------------------------- clipboard-202210160132-n7lzp.png (865 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: