X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=lib%2Fwhenexpr.ml;h=c2ffa334be9c77404579d21d23a15f4192c6ce66;hp=f1f2a89161223711fae7f828fee18660358cd130;hb=27dfc74b71d3b3b14a476667481f92c58a6d5c1d;hpb=f3db678247d4ccc04c6ca1655e2eeec17e1bc169 diff --git a/lib/whenexpr.ml b/lib/whenexpr.ml index f1f2a89..c2ffa33 100644 --- a/lib/whenexpr.ml +++ b/lib/whenexpr.ml @@ -83,15 +83,6 @@ type shell_script = { sh_script : string; } -type result = { - res_job_name : string; - res_code : int; - res_tmpdir : string; - res_output : string; -} - -type cleanup = result -> unit - type variable = | T_unit | T_bool of bool @@ -115,6 +106,31 @@ let rpc_of_variable = function type variables = variable StringMap.t +type preinfo = { + pi_job_name : string; + pi_serial : Big_int.big_int; + pi_variables : (string * variable) list; + pi_running : preinfo_running_job list; +} +and preinfo_running_job = { + pirun_job_name : string; + pirun_serial : Big_int.big_int; + pirun_start_time : float; + pirun_pid : int; +} + +type result = { + res_job_name : string; + res_serial : Big_int.big_int; + res_code : int; + res_tmpdir : string; + res_output : string; + res_start_time : float; +} + +type pre = preinfo -> bool +type post = result -> unit + type job_cond = | When_job of whenexpr | Every_job of periodexpr @@ -122,7 +138,8 @@ type job_cond = type job = { job_loc : Loc.t; job_name : string; - job_cleanup : cleanup option; + job_pre : pre option; + job_post : post option; job_cond : job_cond; job_script : shell_script; }