From: ko1@... Date: 2014-06-10T03:11:43+00:00 Subject: [ruby-core:63038] [ruby-trunk - Feature #3944] Add Fiber#root? method Issue #3944 has been updated by Koichi Sasada. (2014/05/23 15:17), jjyruby@gmail.com wrote: > For example, I want write a method, when under EM::Synchrony environment it should use EM::Synchrony call(in fact is async call, and writing in sync, power by fiber), and when under Fiber#root, it should use sync call, so I need detect whether current fiber is root fiber. Could you break down the description? I don't know EM::Synchrony. Why you need to choose root or not root? -- // SASADA Koichi at atdot dot net ---------------------------------------- Feature #3944: Add Fiber#root? method https://bugs.ruby-lang.org/issues/3944#change-47119 * Author: Mike Perham * Status: Feedback * Priority: Normal * Assignee: Koichi Sasada * Category: * Target version: Next Major ---------------------------------------- =begin 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. =end -- https://bugs.ruby-lang.org/