(clear-loop-flag state')
(join thread-state)
(start-loop init step cleanup)
start loop in separate thread using state returned by init-fn, exit loop on empty new-state or on exception in step-fn or cleared loop-flag
init-fn: setup state' atom in context of the new thread step-fn: do work using state' atom cleanup-fn: get final state and optional exception, free resources bound to the state
start loop in separate thread using state returned by init-fn, exit loop on empty new-state or on exception in step-fn or cleared loop-flag init-fn: setup state' atom in context of the new thread step-fn: do work using state' atom cleanup-fn: get final state and optional exception, free resources bound to the state
(stop-loop thread-state)
reset loop-flag and wait for the thread
reset loop-flag and wait for the thread
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close