Skip to content

on Windows, reading from stdin blocks the whole domain. #793

@bdodrem

Description

@bdodrem

I tried to read a line from stdin with a timeout (code below). On Windows, the process blocks until I press Enter (not on Linux).
So I guess, reading the stdin on Windows blocks the whole domain.

open Eio.Std
open Eio.Buf_read
let _ = Eio_main.run (fun env -> 
    let readoneline () = traceln "%s" @@ parse_exn ~max_size:1024 line env#stdin  in
    Eio.Time.with_timeout_exn env#clock 2. readoneline
  )

Running the code :

$ cat | dune exec ./test.exe

blocks untill Enter is pressed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions