Hi Lance,
Are you trying to create a mechanism for signaling a running script
to stop? I recommend creating your own mechanism using continuations
and having your scripts use it. Something like this:
inline checkSafe
{
if (whatever condition you want)
{
callcc {
warn("Function $1 is now paused");
# save $1 to a var or pass it to some function... $1is a
paused version of the parent function--call it to resume.
};
}
}
Then you can add periodic calls to checkSafe() in your code, places
where it's safe to pause the currently running function.
If you want advice on how this could be done at the Java level
(throwing a Sleep exception or flagging a return), let me know. I
think at the Java level might be dangerous as you can break out of a
function but I don't think you'd be able to resume it. Also the Java
way would have to deal with race conditions.
-- Raphael