-
-
Save ztellman/983370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn handler [ch _] (receive-all ch print) (enqueue ch "hi")) | |
(defn test-harness [] | |
(let [[a b] (channel-pair)] | |
(handler b nil) ;; give handler one side of the channel pair | |
(enqueue a 1 2 3) ;; these will be received by 'b', and the handler will print out '123' | |
(println (channel-seq a)))) ;; will print '["hi"]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment