val wait_event : event option -> unit result
If I use
wait_event I block the OS thread, meaning everything grinds to a halt.
val wait_event_timeout : event option -> int -> bool
This is slightly better, since it allows me to schedule some Lwt threads every now and then, but still halts the main thread.
I feel like I need another OS thread here, and somehow have that write into a
Lwt_mvar.t or similar that I can use from inside Lwt.
Can anyone point me to an example of similar code, or to a possible solution for this problem?