Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2016 20:13
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 anonymous/b5e83b7c75f97236dfea to your computer and use it in GitHub Desktop.
Save anonymous/b5e83b7c75f97236dfea to your computer and use it in GitHub Desktop.
(defn timeout-seq [timeout-ms timeout-val coll]
(lazy-seq
(deref
(future
(when (seq coll)
(cons (first coll)
(timeout-seq timeout-ms
timeout-val
(rest coll)))))
timeout-ms
(cons timeout-val
(timeout-seq
timeout-ms
timeout-val
coll)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment