realworldocaml / mdx

Execute code blocks inside your documentation
ISC License
269 stars 45 forks source link

Work around lack of `Unix.set_nonblock` on Windows using threads #413

Closed polytypic closed 1 year ago

polytypic commented 1 year ago

On Windows Unix.set_nonblock fails.

This PR implements a workaround method for pulling the output without blocking by using threads. I can't say I like the workaround, but implementing proper non-blocking IO on Windows would seem to require a lot more work. This workaround has been tested at least on Mac OS and Windows.

polytypic commented 1 year ago

I'm closing this as reverting PR403 would be a much simpler solution.

Leonidas-from-XIV commented 1 year ago

414 merged to undo the issues that we had with #403.