Skip to content

Instantly share code, notes, and snippets.

@samflores
Created November 5, 2014 19: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 samflores/62cacdf10b6f1a4d1ca9 to your computer and use it in GitHub Desktop.
Save samflores/62cacdf10b6f1a4d1ca9 to your computer and use it in GitHub Desktop.
(def topic-fn [msg]
;; this is what I'm thinking about
)
(def p-ch (chan))
(def p1 topic-fn p-ch)
(def s-ch1
(sub p1 :foo s-ch1)
(def s-ch2
(sub p2 :foo.bar s-ch2)
;; ^-- the topic here is just an idea. any other representation of "nested topics" would be fine
(>!! p-ch {:topic :foo.baz}) ;; only s-ch1 would get this
(>!! p-ch {:topic :foo.bar}) ;; s-ch1 and s-ch2 would get this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment