sig
type t
type worker_info = private {
worker_id : int;
worker_loop : 'a. unit -> 'a;
}
exception Start_worker of Nproc.worker_info
val create :
?init:(Nproc.worker_info -> unit) -> int -> Nproc.t * unit Lwt.t
val close : Nproc.t -> unit Lwt.t
val terminate : Nproc.t -> unit
val submit : Nproc.t -> f:('a -> 'b) -> 'a -> 'b option Lwt.t
val iter_stream :
?granularity:int ->
?init:(Nproc.worker_info -> unit) ->
nproc:int -> f:('a -> 'b) -> g:('b option -> unit) -> 'a Stream.t -> unit
val log_error : (string -> unit) Pervasives.ref
val log_info : (string -> unit) Pervasives.ref
val string_of_exn : (exn -> string) Pervasives.ref
module Full :
sig
type ('a, 'b, 'c) t
val create :
?init:(Nproc.worker_info -> unit) ->
int ->
('a -> 'b Lwt.t) -> 'c -> ('a, 'b, 'c) Nproc.Full.t * unit Lwt.t
val close : ('a, 'b, 'c) Nproc.Full.t -> unit Lwt.t
val terminate : ('a, 'b, 'c) Nproc.Full.t -> unit
val submit :
('a, 'b, 'c) Nproc.Full.t ->
f:(('a -> 'b) -> 'c -> 'd -> 'e) -> 'd -> 'e option Lwt.t
val iter_stream :
?granularity:int ->
?init:(Nproc.worker_info -> unit) ->
nproc:int ->
serv:('a -> 'b Lwt.t) ->
env:'c ->
f:(('a -> 'b) -> 'c -> 'd -> 'e) ->
g:('e option -> unit) -> 'd Stream.t -> unit
end
end