bruno- / fiber_scheduler

Ruby's missing Fiber Scheduler implementation.
MIT License
119 stars 5 forks source link

Bad file descriptor on Windows #2

Open spazer5 opened 2 years ago

spazer5 commented 2 years ago

Awesome project! I tried the Async gem but currently it's not supported on Windows due to io-event gem, so i gave this one a try and ran into an error.

Environment:

Getting an error

<internal:io>:63:in `read_nonblock': Bad file descriptor @ rb_io_set_nonblock - C:/Windows/System32/drivers/etc/hosts (Errno::EBADF)

Reproduction:

require 'fiber_scheduler'
require 'open-uri'

FiberScheduler do
  Fiber.schedule { URI.open('http://ip.me') }
  Fiber.schedule { URI.open('http://ip.me') }
end

I tried a different scheduler found at the very bottom of this article and it works right away but I'm not sure if it's reliable.