Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created February 26, 2012 03:18
Show Gist options
  • Save hugoduncan/1912528 to your computer and use it in GitHub Desktop.
Save hugoduncan/1912528 to your computer and use it in GitHub Desktop.
composing group and server specs
(def s1 (pallet.core/server-spec :phases {:fred (fn [x] (+ x 1))}))
#'user/s1
(def s2 (pallet.core/server-spec :extends [s1] :phases {:fred (fn [x] (+ x 2))}))
#'user/s2
((-> s2 :phases :fred) 0)
3
(def g (pallet.core/group-spec "g" :extends [s2] :phases {:fred (fn [x] (+ x 4))}))
#'user/g
((-> g :phases :fred) 0)
7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment