Skip to content

Instantly share code, notes, and snippets.

@nbeloglazov
Last active November 21, 2016 08:06
Show Gist options
  • Save nbeloglazov/96dee800fe7f1aa5b00b3922afbfbb1c to your computer and use it in GitHub Desktop.
Save nbeloglazov/96dee800fe7f1aa5b00b3922afbfbb1c to your computer and use it in GitHub Desktop.
(def queue (java.util.concurrent.LinkedBlockingDeque.))
; long running proces
(defn do-long-running-stuff []
...
(.add queue current-state))
; quil
; 'draw' waits on queue until it has at least
; one element, removes it from queue and draws
(defn draw []
(let [state (.take queue)]
...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment