ipcSleep
ipcSleep(x_time) =>t
Description
Causes the parent process to be delayed for the given number of seconds.
While the sleep is in progress, incoming data from child processes is buffered. If handlers are defined, they are called and, if there are SKILL commands among the data, they are executed and their results sent back to the child process.
The ipcSleep function gives the programmer a way to break the sequence of evaluations and allow incoming data to take effect without having to return to the SKILL top level.
Arguments
Value Returned
Examples
handler = (lambda (cid data)
when(index(data "cshrc")
path = data))
;; Look for the first occurrence of file .cshrc.
;; Do not spend more than n seconds looking
procedure( look_for_cshrc(n)
path = nil
n = n/2
cid = ipcBeginProcess("cd $HOME ; find . -name '.cshrc' -print" "" handler)
while(and(!path !zerop(n)) ipcSleep(2) n--)
ipcKillProcess(cid)
path
)
look_for_cshrc(150)
"./.cshrc\n"
Related Topics
Interprocess Communication Functions
Return to top