Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created October 26, 2013 00:20
Show Gist options
  • Save MichaelDrogalis/7163819 to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/7163819 to your computer and use it in GitHub Desktop.
(defn put-into-ch [channel car]
(.put channel car))
(defn take-from-channel [channel]
(.take channel))
(defn ch->lane [{:keys [channel state] :as entity} d-fn]
(if-not (zero? (.size channel))
(add-to-lane entity (take-from-channel channel) d-fn)
entity))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment