daemon: Implement 'get_job_names' call to list all loaded jobs.
[whenjobs.git] / daemon / daemon.ml
index 8929cfa..a4993a8 100644 (file)
@@ -80,6 +80,7 @@ let rec init j d =
       ~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
@@ -213,6 +214,9 @@ and proc_set_variables vars =
   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