Legend:
Library
Module
Module type
Parameter
Class
Class type
Transactional interface for atomically completing multiple computations.
⚠️ The implementation of this mechanism is designed to avoid making the single computation completing operations, i.e. try_return and try_cancel, slower and to avoid making computations heavier. For this reason the transaction mechanism is only obstruction-free. What this means is that a transaction may be aborted by another transaction or by a single computation manipulating operation.
try_return tx computation value adds the completion of the computation as having returned the given value to the transaction. Returns true in case the computation had not yet been completed and the transaction was still alive. Otherwise returns false which means that transaction was aborted and it is as if none of the completions succesfully added to the transaction have taken place.
try_cancel tx computation exn bt adds the completion of the computation as having canceled with the given exception and backtrace to the transaction. Returns true in case the computation had not yet been completed and the transaction was still alive. Otherwise returns false which means that transaction was aborted and it is as if none of the completions succesfully added to the transaction have taken place.
try_commit tx attempts to mark the transaction as committed successfully. Returns true in case of success, which means that all the completions added to the transaction have been performed atomically. Otherwise returns false which means that transaction was aborted and it is as if none of the completions succesfully added to the transaction have taken place.