Create a thunk that returns true if given time-limit-in-msec has been
elapsed and bind it to timed-out?. Then execute body.
(defmacro with-timeout
"Create a thunk that returns true if given time-limit-in-msec has been
elapsed and bind it to timed-out?. Then execute body."
#^{:private true}
[[timed-out? time-limit-in-msec] & body]
`(call-with-timeout ~time-limit-in-msec (fn [~timed-out?] ~@body)))
Comments top
No comments for with-timeout. Log in to add a comment.