diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-12-25 15:51:07 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2014-12-25 16:05:27 +0100 |
commit | 0e326def6194606d0f1e21daeb45f32e1a061c8f (patch) | |
tree | b6343d4b7601a7503c1f90e265cd852160304606 /lib/spawn.mli | |
parent | 90ed6636dea41486ddf2cc0daead83f9f0788163 (diff) |
Inlining Spawn.kill_if in the one place were it was actually used, thus
removing the need of thread creation in the interface.
Diffstat (limited to 'lib/spawn.mli')
-rw-r--r-- | lib/spawn.mli | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/spawn.mli b/lib/spawn.mli index 1554e0a1e..b4f615c89 100644 --- a/lib/spawn.mli +++ b/lib/spawn.mli @@ -30,16 +30,11 @@ module type Control = sig (* What is used in debug messages *) val uid : handle -> string - (* Installs a callback, called every [sec] seconds. If the returned value - * is true the process is killed *) - val kill_if : handle -> sec:int -> (unit -> bool) -> unit + val is_alive : handle -> bool end (* Abstraction to work with both threads and main loop models *) -module type Timer = sig - - val add_timeout : sec:int -> (unit -> bool) -> unit -end +module type Empty = sig end module type MainLoopModel = sig type async_chan @@ -51,8 +46,6 @@ module type MainLoopModel = sig val read_all : async_chan -> string val async_chan_of_file : Unix.file_descr -> async_chan val async_chan_of_socket : Unix.file_descr -> async_chan - - include Timer end (* spawn a process and read its output asynchronously *) @@ -71,7 +64,7 @@ module Async(ML : MainLoopModel) : sig end (* spawn a process and read its output synchronously *) -module Sync(T : Timer) : sig +module Sync(T : Empty) : sig type process val spawn : |