package caqti
Unified interface to relational database libraries
Install
Dune Dependency
Authors
Maintainers
Sources
caqti-v1.7.0.tbz
sha256=a363cfcc15f2a3ab9721d08789a65aaa1108d27f974a9b68425a889596e27fb8
sha512=982b9c65fde0405b5d33822ff2743d1c8a8c0611dcd6615dd0af5b32048262f7ddbcae8434193cfd2b7ee845f29c2821d869862b34086099fcffc912b51d61a2
doc/src/caqti.blocking/caqti_blocking.ml.html
Source file caqti_blocking.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
(* Copyright (C) 2018--2021 Petter A. Urkedal <paurkedal@gmail.com> * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at your * option) any later version, with the LGPL-3.0 Linking Exception. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * and the LGPL-3.0 Linking Exception along with this library. If not, see * <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *) open Caqti_common_priv module System = struct type 'a future = 'a let (>>=) x f = f x let (>|=) x f = f x let return x = x let finally f g = (match f () with | y -> g (); y | exception exn -> g (); raise exn) let cleanup f g = try f () with exn -> g (); raise exn let join (_ : unit list) = () module Mvar = struct type 'a t = 'a option ref let create () = ref None let store x v = v := Some x let fetch v = (match !v with | None -> failwith "Attempt to fetch empty mvar from blocking client." | Some x -> x) end module Log = struct type 'a log = 'a Logs.log let err ?(src = default_log_src) = Logs.err ~src let warn ?(src = default_log_src) = Logs.warn ~src let info ?(src = default_log_src) = Logs.info ~src let debug ?(src = default_log_src) = Logs.debug ~src end module Unix = struct type file_descr = Unix.file_descr let wrap_fd f fd = f fd let poll ?(read = false) ?(write = false) ?(timeout = -1.0) fd = let read_fds = if read then [fd] else [] in let write_fds = if write then [fd] else [] in let read_fds, write_fds, _ = Unix.select read_fds write_fds [] timeout in (read_fds <> [], write_fds <> [], read_fds = [] && write_fds = []) end module Preemptive = struct let detach f x = f x let run_in_main f = f () end module Stream = Caqti_stream.Make (struct type 'a future = 'a let (>>=) x f = f x let (>|=) x f = f x let return x = x end) end type 'a future = 'a include Caqti_connect.Make_unix (System) let or_fail = function | Ok x -> x | Error (#Caqti_error.t as err) -> raise (Caqti_error.Exn err)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>