package caqti
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3ceea06ba0e8e8bcab0386b5817b68cb30fce457eaa25ada0182891d66f6a0b9
sha512=e01f546a45b04cafd5fa262e9228e5a1aabd5e0942059c073a4181c928450baf3d990cc59ffb1a33dff445b46a0e218224a23dca96e8d24cdd0ab793d08e4538
doc/caqti/Caqti/Switch/module-type-S/index.html
Module type Switch.SSource
Explicit Construction and Release
The following functions are resource-unsafe, since do not scope the lifetime of constructed switches to a function call like run. They are nevertheless useful for applications which do not follow the EIO-style resource handling discipline. The caqti-eio package uses the native EIO switch implementation, which excludes these functions.
val eternal : tA switch which is never released.
val create : unit -> tCreate a fresh releasable switch which is initially on.
release sw calls all cleanup handlers on sw in reverse order of registration and marks the switch as being off.
EIO-Compatible Interface
run f calls f with a fresh switch which will be released upon exit or in case of failure.
val check : t -> unitcheck sw raises Off if sw has been turned off.
on_release_cancellable sw f registers f to be called upon the evetual release of sw unless remove_hook is called on the returned hook before that happen.
val remove_hook : hook -> unitGiven a hook returned by on_release_cancellable, remove_hook hook cancels the cleanup registered by that call.