package opam-core

  1. Overview
  2. Docs

Module OpamProcess.JobSource

Higher-level interface to allow parallelism

Sourcemodule Op : sig ... end

Open type and add combinators. Meant to be opened

Sourceval run : 'a Op.job -> 'a

Sequential run of a job

Sourceval dry_run : 'a Op.job -> 'a

Same as run but doesn't actually run any shell command, and feed a dummy result to the cont.

Sourceval catch : (exn -> 'a Op.job) -> (unit -> 'a Op.job) -> 'a Op.job

Catch exceptions raised within a job

Sourceval ignore_errors : default:'a -> ?message:string -> (unit -> 'a Op.job) -> 'a Op.job

Ignore all non-fatal exceptions raised by job and return default

Sourceval finally : (unit -> unit) -> (unit -> 'a Op.job) -> 'a Op.job

Register an exception-safe finaliser in a job. finally job fin is equivalent to catch job (fun e -> fin (); raise e) @@+ fun r -> fin (); Done r

Sourceval of_list : ?keep_going:bool -> command list -> (command * result) option Op.job

Converts a list of commands into a job that returns None on success, or the first failed command and its result. Unless keep_going is true, stops on first error.

Sourceval of_fun_list : ?keep_going:bool -> (unit -> command) list -> (command * result) option Op.job

As of_list, but takes a list of functions that return the commands. The functions will only be evaluated when the command needs to be run.

Sourceval seq : ('a -> 'a Op.job) list -> 'a -> 'a Op.job

Returns the job made of the given homogeneous jobs run sequentially

Sourceval seq_map : ('a -> 'b Op.job) -> 'a list -> 'b list Op.job

Sequentially maps jobs on a list

Sourceval with_text : string -> 'a Op.job -> 'a Op.job

Sets and overrides text of the underlying commands

OCaml

Innovation. Community. Security.