package miou
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=d9ae52113d923f2425a1375c594f4accf61171780af1ef211dbbba38ff51dacf
sha512=f114d1d4b1ff0c7bbe74adbb2fa65a7343064a14ea252b8ae5dbd98c209b3c1d56f2e360422ea8e5cd2656a6f50cb10ae262b0c4e6681724803dd6e8eb1d1653
doc/miou.sync/Miou_sync/Computation/index.html
Module Miou_sync.Computation
Source
type 'a state =
| Cancelled of exn * Printexc.raw_backtrace
| Returned of 'a
| Continue of {
balance : int;
triggers : Trigger.t list;
}
try_return c value
attempts to complete the computation with the specified value
and returns true
on success. Otherwise returns false
, which means that the computation had already been completed before.
try_capture c fn x
calls fn x
and tries to complete the computation with the value returned or the exception raised by the call and returns true
on success. Otherwise returns false
, which means that the computation had already been completed before.
try_cancel c (exn, bt)
attempts to mark the computation c
as cancelled with the specified exception and backtrace and returns true
on success. Otherwise returns false
, which means that the computation had already been completed before.
is_running c
determines whether the computation c
is in the running state meaning that it has not yet been completed.
cancelled c
returns the exception that the computation has been cancelled with or returns None
in case the computation has not been cancelled.
raise_if_errored
raises the exception the computation was cancelled with if it was errored.
peek c
returns the result of the computation c
or None
in case the computation has not completed.
try_attach c trigger
tries to attach the trigger to be signaled on completion of the computation and returns true
on success. Otherwise, it returns false
, which means that the computation has already been completed or the trigger has already been signaled.
detach c trigger
signals the trigger and detaches it from the computation c
.
await c
waits for the computation to complete and either returns the value of the completed computation or the exception the computation was cancelled with.