Skip to content

Instantly share code, notes, and snippets.

@amalloy

amalloy/feed.clj Secret

Created August 17, 2011 01:07
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 amalloy/f30273d77ae8301d2852 to your computer and use it in GitHub Desktop.
Save amalloy/f30273d77ae8301d2852 to your computer and use it in GitHub Desktop.
;; prefer this?
(for [[revision-id outboxes] stories,
outbox outboxes,
:let [item-label (inbox-item outbox revision-id)]]
(cons [:zadd (outbox-key outbox) revision-id revision-id]
(for [subscriber (subscribers outbox)]
[:zadd (inbox-key subscriber) revision-id item-label])))
;; or this?
(for [[revision-id outboxes] stories,
outbox outboxes]
(let [item-label (inbox-item outbox revision-id)]
(cons [:zadd (outbox-key outbox) revision-id revision-id]
(for [subscriber (subscribers outbox)]
[:zadd (inbox-key subscriber) revision-id item-label]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment