package MlFront_Thunk
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Describes and runs reproducible units of work called thunks
Install
dune-project
Dependency
Authors
Maintainers
Sources
MlFront.tar.gz
md5=aeb01176ff012ed278135b2f8347ee97
sha512=8bcddec2ab379ebd20cb9dedc216cd94ee0c9f5462294736c5ea12799a90bb1e16fb68c63e42a46539a58d318850186823d370682e145bed22ec40a89cf7d202
doc/MlFront_Thunk.ThunkIoDisk/MlFront_Thunk_IoDisk/ThunkIoDisk/Make/index.html
Module ThunkIoDisk.MakeSource
Parameters
Signature
include sig ... end
Source
type file_object = private {file_origin : string;is_local_file : bool;open_for_writing : unit -> [ `Error of string | `IsDirectory of directory_object | `Node of Int64.t ] M.t;open_for_reading : unit -> [ `Error of string | `IsDirectory of directory_object | `Node of Int64.t ] M.t;read_some : Int64.t -> [ `Bytes of bytes * int * int | `Eof | `Error of string ] M.t;write_all : Int64.t -> string -> int -> int -> [ `Error of string | `WroteBytes ] M.t;close : Int64.t -> unit M.t;read_all : unit -> [ `Content of string | `Error of string | `ExceededSizeLimit of int64 ] M.t;prepare_as_copy_destination : unit -> [ `Error of string | `Ready ] M.t;delete_file : unit -> [ `Deleted | `Error of string ] M.t;checksum_file : strip_carriage_returns:bool -> algo:[ `Sha1 | `Sha256 ] -> unit -> [ `Checksum of string * Int64.t | `Error of string ] M.t;
}Source
and directory_object = private {dir_origin : string;create_directory : unit -> [ `Created | `Error of string ] M.t;delete_directory : unit -> [ `Deleted | `Error of string ] M.t;zip_directory : ?intermediate:unit -> staging_dir:directory_object -> unit -> [ `Error of string | `ZipFile of file_object ] M.t;spawn_in_directory : command:MlFront_Core.FilePath.t -> args:string list -> envmods:MlFront_Core.EnvMods.t -> stdout:file_object -> stderr:file_object -> unit -> [ `Error of string | `Exited of int | `Signaled of int | `Stopped of int ] M.t;interactive_shell_in_directory : ?promptname:string -> envmods:MlFront_Core.EnvMods.t -> unit -> [ `Error of string | `Exited of int | `Signaled of int | `Stopped of int ] M.t;
}Source
val generic_file :
origin:string ->
is_local_file:bool ->
open_for_writing:
(unit ->
[ `Error of string
| `IsDirectory of directory_object
| `Node of Int64.t ]
M.t) ->
open_for_reading:
(unit ->
[ `Error of string
| `IsDirectory of directory_object
| `Node of Int64.t ]
M.t) ->
read_some:
(Int64.t -> [ `Bytes of bytes * int * int | `Eof | `Error of string ] M.t) ->
write_all:
(Int64.t -> string -> int -> int -> [ `Error of string | `WroteBytes ] M.t) ->
close:(Int64.t -> unit M.t) ->
read_all:
(unit ->
[ `Content of string | `Error of string | `ExceededSizeLimit of int64 ]
M.t) ->
prepare_as_copy_destination:(unit -> [ `Error of string | `Ready ] M.t) ->
delete_file:(unit -> [ `Deleted | `Error of string ] M.t) ->
checksum_file:
(strip_carriage_returns:bool ->
algo:[ `Sha1 | `Sha256 ] ->
unit ->
[ `Checksum of string * Int64.t | `Error of string ] M.t) ->
unit ->
file_objectSource
val generic_dir :
origin:string ->
create_directory:(unit -> [ `Created | `Error of string ] M.t) ->
delete_directory:(unit -> [ `Deleted | `Error of string ] M.t) ->
zip_directory:
(?intermediate:unit ->
staging_dir:directory_object ->
unit ->
[ `Error of string | `ZipFile of file_object ] M.t) ->
spawn_in_directory:
(command:MlFront_Core.FilePath.t ->
args:string list ->
envmods:MlFront_Core.EnvMods.t ->
stdout:file_object ->
stderr:file_object ->
unit ->
[ `Error of string
| `Exited of int
| `Signaled of int
| `Stopped of int ]
M.t) ->
interactive_shell_in_directory:
(?promptname:string ->
envmods:MlFront_Core.EnvMods.t ->
unit ->
[ `Error of string
| `Exited of int
| `Signaled of int
| `Stopped of int ]
M.t) ->
unit ->
directory_objectSource
val read_all :
file_object ->
[ `Content of string | `Error of string | `ExceededSizeLimit of int64 ] M.tSource
val copy :
src:file_object ->
dest:file_object ->
unit ->
[ `Copied
| `DestinationIsDirectory of directory_object
| `Error of string
| `SourceIsDirectory of directory_object ]
M.tSource
val copy_or_fail :
src:file_object ->
dest:file_object ->
on_error:(string -> 'a M.t) ->
'a M.t ->
'a M.tSource
val copy_but_error_if_dest_is_dir :
src:file_object ->
dest:file_object ->
unit ->
[ `Copied | `Error of string | `SourceIsDirectory of directory_object ] M.tSource
val checksum_file :
?strip_carriage_returns:unit ->
algo:[ `Sha1 | `Sha256 ] ->
file_object ->
[ `Checksum of string * Int64.t | `Error of string ] M.tSource
val replace_all_bytes :
file_object ->
bytes ->
int ->
int ->
[ `Error of string | `IsDirectory of directory_object | `WroteBytes ] M.tSource
val replace_all_string :
file_object ->
string ->
int ->
int ->
[ `Error of string | `IsDirectory of directory_object | `WroteBytes ] M.tSource
val spawn_in_directory :
command:MlFront_Core.FilePath.t ->
args:string list ->
cwd:directory_object ->
envmods:MlFront_Core.EnvMods.t ->
stdout:file_object ->
stderr:file_object ->
unit ->
[ `Error of string | `Exited of int | `Signaled of int | `Stopped of int ]
M.tSource
val interactive_shell_in_directory :
?promptname:string ->
envmods:MlFront_Core.EnvMods.t ->
cwd:directory_object ->
unit ->
[ `Error of string | `Exited of int | `Signaled of int | `Stopped of int ]
M.tSource
val copy_file_or_dir_to_file_and_sha256_or_fail :
?intermediate:unit ->
src:file_object ->
dest:file_object ->
staging_dir:directory_object ->
on_error:(string -> 'b M.t) ->
(string -> int64 -> 'b M.t) ->
'b M.tmemory_limit.
16 MiB is the maximum on 32-bit OCaml platforms for a single string. However, js_of_ocaml uses maximum JavaScript string size which is undocumented but at least 2^51.
We'll use 2^31 - 1 as limit for now as that is the memory bound for 32-bit signed C integers.
disk_file origin creates a new file object that reads from the disk from the file origin. The file is read synchronously, so use a different file object implementation for asynchronous reads.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page