type waiter =
{ w_wait : unit Lwt.t;
w_waker: unit Lwt.u option;
mutable w_did_wait : bool }
I don't understand why there are "unit
" in w_wait
and w_waker
?
type waiter =
{ w_wait : unit Lwt.t;
w_waker: unit Lwt.u option;
mutable w_did_wait : bool }
I don't understand why there are "unit
" in w_wait
and w_waker
?
Copyright © 2021 Jogjafile Inc.
According to Lwt's doc the type
'a Lwt.t
is the "type of threads returning a result of type 'a.", so yourw_wait
is a cooperative thread returning unit (i.e. having only side effects). Likewise'a Lwt.u
is the "type of thread wakeners".I don't understand what you don't understand in Lwt documentation. It seems quite understandable to me.