Skip to content

Instantly share code, notes, and snippets.

@srid
Created September 19, 2011 20:50
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 srid/1227572 to your computer and use it in GitHub Desktop.
Save srid/1227572 to your computer and use it in GitHub Desktop.
(defn pop-log
"Pop the oldest entry from the log; return nil if none available"
[]
(when-not (empty? @incoming-log)
;; this is not right; peek'ing before pop'ing; queue may be modified in between?
(let [peeked (peek @incoming-log)]
(send incoming-log pop)
peeked)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment