Skip to content

Instantly share code, notes, and snippets.

@shayanjm
Created July 4, 2014 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shayanjm/d37b5b34b08281fa0aa7 to your computer and use it in GitHub Desktop.
Save shayanjm/d37b5b34b08281fa0aa7 to your computer and use it in GitHub Desktop.
(defn infinite-loop-on-realization
"Given a function, loop that function on realization indefinitely."
[func]
(let [current-exec (future (func))]
(when (realized? current-exec)
(infinite-loop-on-realization func))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment