Feature #17407
closedFiber.current and require 'fiber'
Description
Maybe it is not the right time to ask, but why one need to do require 'fiber'
before using Fiber.current
?
For what I can see,
- it is this way since their introduction,
- the actual code is defined in the core cont.c
- the
ext/fiber.c
does very little
I was just bitten by it again preparing the changelog (stuck with NoMethodError
and for a few minutes thought the build is broken), is there a reason to have it this way?..
Just clarifying for docs sake, at least.
Updated by Eregon (Benoit Daloze) almost 4 years ago
Maybe we should just include these Fiber methods in core, and require 'fiber'
would be a no-op (for compatibility)?
Agreed it's confusing such a core class has only half the documented methods defined without an extra require
.
Updated by nobu (Nobuyoshi Nakada) almost 4 years ago
- Tracker changed from Misc to Feature
Updated by ko1 (Koichi Sasada) almost 4 years ago
I still think Fiber.current
is not needed because Fiber#transfer
is not easy feature to use.
However, Fiber scheduler is introduced and they can be utilize.
So I'm okay for nobu's PR.
Updated by nobu (Nobuyoshi Nakada) almost 4 years ago
- Status changed from Open to Closed
Applied in changeset git|521ad9a13aef1e1dae4eaff70d3e6b2e358aa095.
Moved Fiber methods into core [Feature #17407]