~proc_start_job
~proc_get_job
~proc_set_variables
+ ~proc_get_job_names
(Rpc_server.Unix addr)
Rpc.Tcp (* not TCP, this is the same as SOCK_STREAM *)
Rpc.Socket
with
Failure msg -> `error msg
+and proc_get_job_names () =
+ Array.of_list (Whenstate.get_job_names !state)
+
(* Reload the jobs file. *)
and reload_file () =
let file = sprintf "%s/jobs.cmo" !jobsdir in
typedef job job_list<>;
+typedef job_name job_name_list<>;
+
/* The API of the daemon. */
program When {
version V1 {
status start_job (job_name) = 8;
job get_job (string_big_int) = 9;
status set_variables (set_variable_list) = 10;
+ job_name_list get_job_names (void) = 11;
} = 1;
} = 0x20008081;
let get_job t jobname =
StringMap.find jobname t.jobmap
+let get_job_names t =
+ List.map (function { job_name = name } -> name) t.jobs
+
let evaluate_whenjob ?(onload = false) t job =
match job with
| { job_cond = Every_job _ } -> assert false
val get_job : t -> string -> Whenexpr.job
(** Return the named job, or raise [Not_found]. *)
+val get_job_names : t -> string list
+(** Return the names of all jobs (running or not). *)
+
val evaluate_whenjob : ?onload:bool -> t -> Whenexpr.job -> bool * t
(** This evaluates the whenjob and returns [true] iff the whenjob
should be run now.