From: billk@... Date: 2016-05-19T04:36:34+00:00 Subject: [ruby-core:75606] [Ruby trunk Feature#3944] Add Fiber#root? method Issue #3944 has been updated by B Kelly. Nobuyoshi Nakada wrote: > Couldn't anyone explain how the method will be used and why it will be necessary? > As far as I read, it sounds that it's EM specific and EM should take care of it. It might indeed be EM-specific. I have an RPC library based around EventMachine and fibers. It needs to record `Fiber.current` at the point `EventMachine.run` is called. The library then uses `RPC.on_em_fiber?` (i.e. `Fiber.current == @em_fiber`) to make necessary choices similar to those described by earlier posters. If this is indeed equivalent to what earlier posters have requested, it does seem like functionality that could be provided by `EM` or `EM::Synchrony`. Regards, Bill ---------------------------------------- Feature #3944: Add Fiber#root? method https://bugs.ruby-lang.org/issues/3944#change-58743 * Author: Mike Perham * Status: Feedback * Priority: Normal * Assignee: Koichi Sasada ---------------------------------------- Since the root fiber is treated differently than other Fibers (e.g. you can't yield from the root), code which can optionally use fibers for high-performance IO (in my case, the Mysql2 driver) needs `Fiber#root?` to know when it can use Fibers to execute a query versus using a standard blocking call. -- https://bugs.ruby-lang.org/ Unsubscribe: