package lwt
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=9bccdb35c84cb8097233b3a875f08826
sha512=3c92e3359ee742b9647dc8392b71c2d725b23549327aaab772d48d016d7abb8f0d710d0e9bdc0fd2406e0cbc4ea182cd134446fe4356538795d173cc6a9e0a27
doc/lwt/Lwt_mvar/index.html
Module Lwt_mvarSource
Mailbox variables
“Mailbox” variables implement a synchronising variable, used for communication between concurrent threads.
The type of a mailbox variable. Mailbox variables are used to communicate values between threads in a synchronous way. The type parameter specifies the type of the value propagated from put to take.
put mvar value puts a value into a mailbox variable. This value will remain in the mailbox until take is called to remove it. If the mailbox is not empty, the current thread will block until it is emptied.
take mvar will take any currently available value from the mailbox variable. If no value is currently available, the current thread will block, awaiting a value to be put by another thread.
take_available mvar immediately takes the value from mvar without blocking, returning None if the mailbox is empty.