package async_interactive

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val run : f:(unit -> 'a Async.Deferred.t) -> ('r, unit, string, 'a Async.Deferred.t) Core.format4 -> 'r

This module allows you to have messages printed when you start and finish jobs without having a bad interaction in case of interleaved jobs run in parallel.

Example of code:

Interactive.Job.run !"starting doing stuff A in process %{Pid}" pid
  ~f:(fun () -> do_stuff_A ())
>>= fun () ->

Example of output:

1 process:

        starting doing stuff A in process 1234 ... done.

Multiple processes:

        starting doing stuff A in process 1234 ...
        starting doing stuff A in process 4321 ...
        all done.
        starting doing stuff A in process 5678 ... done.
OCaml

Innovation. Community. Security.