-(* (1) fdmap maps fifo fds -> service names, for initial read events
- * (2) pidmap maps pids of currently executing services into fds for sigchlds to
- * prevent the appearence of zombies and to define the end of a session.
- * (3) open_fds maps read events into active services
- *)
let fdmap: (Unix.file_descr,string*string) Hashtbl.t = Hashtbl.create 1024
let pidmap: (int,signed_fd*signed_fd*Unix.file_descr) Hashtbl.t = Hashtbl.create 1024
let backend_prefix = ref ""
let open_fds: (Unix.file_descr,channel_pipe) Hashtbl.t = Hashtbl.create 1024
let fdmap: (Unix.file_descr,string*string) Hashtbl.t = Hashtbl.create 1024
let pidmap: (int,signed_fd*signed_fd*Unix.file_descr) Hashtbl.t = Hashtbl.create 1024
let backend_prefix = ref ""
let open_fds: (Unix.file_descr,channel_pipe) Hashtbl.t = Hashtbl.create 1024
-
-
-let receive_process_event (idesc:fd_and_fname) (_:fd_and_fname) =
- printf "Process event\n";flush Pervasives.stdout;
+(** Receive an event from a running script. This event must be relayed to the
+ slice that invoked it
+ @param idesc fd/fname identifier for process
+ *)
+let receive_process_event (idesc: fname_and_fd) (_: fname_and_fd) =
fprintf fifo_outchan "%s\n" curline;flush fifo_outchan
with
| End_of_file|Sys_blocked_io|Unix_error(EPIPE,_,_)|Unix_error(EBADF,_,_) ->
fprintf fifo_outchan "%s\n" curline;flush fifo_outchan
with
| End_of_file|Sys_blocked_io|Unix_error(EPIPE,_,_)|Unix_error(EBADF,_,_) ->
|Sys_blocked_io ->printf "Sysblockedio\n";flush Pervasives.stdout;
cont:=false
| _ ->printf "Bug: unhandled exception\n";flush Pervasives.stdout;raise Bug
|Sys_blocked_io ->printf "Sysblockedio\n";flush Pervasives.stdout;
cont:=false
| _ ->printf "Bug: unhandled exception\n";flush Pervasives.stdout;raise Bug
let openentry fqp abspath perm =
let fifoin = String.concat "." [fqp;"in"] in
let fifoout = String.concat "." [fqp;"out"] in
let openentry fqp abspath perm =
let fifoin = String.concat "." [fqp;"in"] in
let fifoout = String.concat "." [fqp;"out"] in