package git
All checked builds pass sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Git format and protocol in pure OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
git-3.19.0.tbz
sha256=227385f431a39cda22094615ae4c9d834bc91d51cc2d82e1739db307f9987c6d
sha512=29842d41018a3b6607be9da5967c215fd42ea047a529de3a19d9f51048db67842acbdae572eb0bb2e59f3d181fd787f3f0c304e7538112ebbaa310f1b6ab498b
doc/src/smart_flow/smart_flow.ml.html
Source file smart_flow.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 54open Sigs module Log = (val let src = Logs.Src.create "smart_flow" in Logs.src_log src : Logs.LOG) let io_buffer_size = 65536 type ('a, 's) raise = exn -> ('a, 's) io let run : type fl s. s scheduler -> ('a, s) raise -> (fl, 'error, s) flow -> fl -> ('res, [ `Protocol of Smart.error ]) Smart.t -> ('res, s) io = fun { bind; return } raise { recv; send; pp_error } flow fiber -> let ( >>= ) = bind in let tmp = Cstruct.create io_buffer_size in let failwithf fmt = Format.kasprintf (fun err -> raise (Failure err)) fmt in let rec go = function | Smart.Read { k; buffer; off; len; eof } -> ( let max = min (Cstruct.length tmp) len in Log.debug (fun m -> m "Start to read %d byte(s)." max); recv flow (Cstruct.sub tmp 0 max) >>= function | Ok `End_of_flow -> Log.debug (fun m -> m "Got end of input."); go (eof ()) | Ok (`Input len) -> Log.debug (fun m -> m "Got %d/%d byte(s)." len max); Cstruct.blit_to_bytes tmp 0 buffer off len; go (k len) | Error err -> Log.err (fun m -> m "Got an error: %a." pp_error err); failwithf "%a" pp_error err) | Smart.Write { k; buffer; off; len } -> let rec loop tmp = if Cstruct.length tmp = 0 then go (k len) else send flow tmp >>= function | Ok shift -> loop (Cstruct.shift tmp shift) | Error err -> failwithf "%a" pp_error err in Log.debug (fun m -> m "Write %d byte(s)." len); loop (Cstruct.of_string buffer ~off ~len) | Smart.Return v -> return v | Smart.Error (`Protocol err) -> Log.err (fun m -> m "Got a protocol error: %a." Smart.pp_error err); failwithf "%a" Smart.pp_error err in go fiber
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>