Created
March 16, 2012 06:43
-
-
Save mavericklou/2048809 to your computer and use it in GitHub Desktop.
aleph 0.2.1-alpha2-SNAPSHOT hang when compile
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
(ns alephtest.core | |
(:use aleph.core | |
aleph.http | |
lamina.core | |
)) | |
(defn put-handler | |
[ch request] | |
(println "######") | |
(let [is (:body request) | |
out-ch (channel)] | |
(while (pos? (.available is)) | |
(enqueue out-ch (.readLine is)))) | |
(enqueue ch | |
{:status 200 | |
:headers {"content-type" "text/plain"} | |
:body "OK"})) | |
(defn start [port] | |
(start-http-server (wrap-ring-handler (wrap-aleph-handler put-handler)) {:port port})) | |
(defn -main [& args] | |
(start 8675)) |
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
(defproject alephtest "1.0.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:dependencies [[org.clojure/clojure "1.2.0"] | |
[aleph "0.2.1-alpha2-SNAPSHOT"] | |
] | |
:main alephtest.core) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment