From: ko1@... Date: 2017-01-31T08:47:07+00:00 Subject: [ruby-core:79340] [Ruby trunk Feature#3944] Add Fiber#root? method Issue #3944 has been updated by Koichi Sasada. Sorry for very late response. Victor Maslov wrote: > Now I want to reuse the `method_that_gets_data` without fibers -- to know whether to yield or to work until done I need to know if I'm running inside Fiber or not. You shouldn't rely on `root?` because some libraries (for example, some kind of Enumerator objects) use fibers. ---------------------------------------- Feature #3944: Add Fiber#root? method https://bugs.ruby-lang.org/issues/3944#change-62761 * Author: Mike Perham * Status: Feedback * Priority: Normal * Assignee: Koichi Sasada * Target version: ---------------------------------------- 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: