package caqti

Some checked builds fail
  1. Overview
  2. Docs
Unified interface to relational database libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

caqti-v3.1.0.tbz
sha256=43cfd7d41627be269449d1f17c4962876d2b383d12fe8c0574e0e07aa3d95243
sha512=b46dcf9e7c012aeefa80f143c840c80d7acd6bb30cd1657486d1adfe345d3570078667caeed728865905c9afd73083ffb1b6983cad7f7ef30e35550506c94c22

doc/caqti.platform/Caqti_platform/Switch/Make/index.html

Module Switch.MakeSource

Parameters

module Fiber : FIBER

Signature

Sourcetype t
Sourcetype hook
Sourceexception Off

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.

Sourceval eternal : t

A switch which is never released.

Sourceval create : unit -> t

Create a fresh releasable switch which is initially on.

Sourceval release : t -> unit Fiber.t

release sw calls all cleanup handlers on sw in reverse order of registration and marks the switch as being off.

EIO-Compatible Interface

Sourceval run : (t -> 'a Fiber.t) -> 'a Fiber.t

run f calls f with a fresh switch which will be released upon exit or in case of failure.

Sourceval check : t -> unit

check sw raises Off if sw has been turned off.

Sourceval on_release_cancellable : t -> (unit -> unit Fiber.t) -> hook

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.

Sourceval remove_hook : hook -> unit

Given a hook returned by on_release_cancellable, remove_hook hook cancels the cleanup registered by that call.