Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; in publication.clj
- (def ^:private publisher-channel (chan))
- (def ^:private publication
- (pub publisher-channel (constantly :new-event)))
- (defrecord PublicationComponent []
- component/Lifecycle
- (start [component]
- (assoc component :publication publication))
- (stop [component]
- (unsub-all publication)
- (dissoc component :publication)))
- (defn publication-component []
- (->PublicationComponent))
- ;; in system.clj
- (defn new-system [config]
- (let [config (meta-merge base-config config)]
- (-> (component/system-map
- :publication (publication-component))
- (component/system-using
- {:publication []}))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement