-
-
Save nbeloglazov/96dee800fe7f1aa5b00b3922afbfbb1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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