Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / engine.sig
1 (* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature ENGINE =
10 sig
11 type 'a t
12
13 datatype 'a res =
14 Done of 'a
15 | Raise of exn
16 | TimeOut of 'a t
17
18 val new: (unit -> 'a) -> 'a t
19 val repeat: {thunk: unit -> 'a,
20 limit: Time.t,
21 tries: int} -> 'a option
22 val run: 'a t * Time.t -> 'a res
23 val timeLimit: Time.t * (unit -> 'a) -> 'a option
24 end