From 0f6a9c150b1a93358f6e9f8de5072fff52625ab9 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 16 May 2014 20:18:02 +0200 Subject: Declare: fix Future management --- lib/future.ml | 2 ++ lib/future.mli | 3 +++ 2 files changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/future.ml b/lib/future.ml index 690255edda..77386a1a9f 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -90,6 +90,8 @@ let uuid kx = let id, _, _ = get kx in id let from_val ?(fix_exn=id) v = create fix_exn (Val (v, None)) let from_here ?(fix_exn=id) v = create fix_exn (Val (v, Some (!freeze ()))) +let fix_exn_of ck = let _, fix_exn, _ = get ck in fix_exn + let default_force () = raise NotReady let assignement ck = fun v -> let _, fix_exn, c = get ck in diff --git a/lib/future.mli b/lib/future.mli index 09d18ff269..b4eced06a9 100644 --- a/lib/future.mli +++ b/lib/future.mli @@ -84,6 +84,9 @@ val from_val : ?fix_exn:fix_exn -> 'a -> 'a computation the value is not just the 'a but also the global system state *) val from_here : ?fix_exn:fix_exn -> 'a -> 'a computation +(* To get the fix_exn of a computation *) +val fix_exn_of : 'a computation -> fix_exn + (* Run remotely, returns the function to assign. Optionally tekes a function that is called when forced. The default one is to raise NotReady. The assignement function does not change the uuid. *) -- cgit v1.2.3