Lwt misbehaving?

I’m following the introduction to Lwt in the manual: https://ocsigen.org/lwt/manual/

# let ic, oc = Lwt_io.pipe ();;
val ic : Lwt_io.input_channel = <abstr>
val oc : Lwt_io.output_channel = <abstr>
# let t = Lwt_io.read_char ic;;
val t : char Lwt.t = <abstr>
# Lwt.state t;;
- : char Lwt.state = Lwt.Sleep
# Lwt_io.write_char oc 'a';;
- : unit Lwt.t = <abstr>
# Lwt.state t;;
- : char Lwt.state = Lwt.Sleep

Why is the thread not returning the char after writing to the output channel as the manual shows?

It does for me with lwt 3.3.0, though I suspect one should Lwt_io.flush oc before the read to be sure.

1 Like

I have lwt 4.1.0. Does it look like a bug? If someone else can reproduce it with 4.1.0, I can file a bug report.

Update: I installed conf-libev, which forced recompilation of lwt. Now the issue seems to be resolved.

1 Like