Project

General

Profile

Actions

Bug #18484

closed

Fiber should return it self when blocked by IO

Added by jakit (Jakit Liang) over 2 years ago. Updated about 2 years ago.

Status:
Rejected
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
[ruby-core:107097]

Description

Here's an example:

f = Fiber.new do
  sleep(1)
  Fiber.yield 123
end

p f.resume

Output:

nil

Expected output:

#<Fiber:0x000000010e825b18@(irb):59 (paused)>

========================

In JavaScipt, an example like:

async function testAsync() {
    return "hello async";
}

const result = testAsync();
console.log(result);

Output:

Promise { 'hello async' }
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0