Created
May 22, 2015 02:10
-
-
Save zmaril/ce4cb4b17d62c33c1924 to your computer and use it in GitHub Desktop.
This file contains 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
(ns example.test | |
(:require [aleph.tcp :as tcp] | |
[manifold.stream :as stream])) | |
(defn handler [s info] | |
(println "START") | |
(println @(stream/take! s)) | |
(println "STOP")) | |
(defn start-server | |
[port] | |
(tcp/start-server handler {:port port})) | |
(def server (start-server 5555)) | |
(def c @(tcp/client {:port 5555 :host "localhost"})) | |
(stream/put! c "example") | |
;;Prints only the following | |
;;START |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment