diff options
author | zverok <[email protected]> | 2020-12-23 08:14:18 +0200 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-12-24 14:37:09 +0900 |
commit | 24ae0e8ed73947e030b31badb9d620ddf71898b6 (patch) | |
tree | 74fd42d0030395dba991c7a5a3b1cb61de9717b4 /cont.c | |
parent | 5696c693540a06c01bf6172d33aff731ad61f871 (diff) |
Review comments
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3981
Diffstat (limited to 'cont.c')
-rw-r--r-- | cont.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -2465,17 +2465,24 @@ rb_fiber_backtrace_locations(int argc, VALUE *argv, VALUE fiber) * mixed. * * * If the Fiber's lifecycle had started with transfer, it will never - * be able to participate in yield/resume control passing, only - * finish or transfer back. + * be able to yield or be resumed control passing, only + * finish or transfer back. (It still can resume other fibers that + * are allowed to be resumed.) * * If the Fiber's lifecycle had started with resume, it can yield * or transfer to another Fiber, but can receive control back only * the way compatible with the way it was given away: if it had * transferred, it only can be transferred back, and if it had * yielded, it only can be resumed back. After that, it again can - * transfer or yield + * transfer or yield. * * If those rules are broken FiberError is raised. * + * For an individual Fiber design, yield/resume is more easy to use + * style (the Fiber just gives away control, it doesn't need to think + * about who the control is given to), while transfer is more flexible + * for complex cases, allowing to build arbitrary graphs of Fibers + * dependent on each other. + * * * Example: * |