diff --git a/clj-browserchannel-netty-adapter/README.md b/clj-browserchannel-netty-adapter/README.md deleted file mode 100644 index e2f14a6..0000000 --- a/clj-browserchannel-netty-adapter/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# clj-browserchannel-netty-adapter - -Netty adapter for use with BrowserChannel on top of Aleph. - -See also: [clj-browserchannel][1] -[1]:https://github.com/thegeez/clj-browserchannel - -## About - -Written by: -Gijs Stuurman / [@thegeez][twt] / [Blog][blog] / [GitHub][github] - -[twt]: http://twitter.com/thegeez -[blog]: http://thegeez.github.com -[github]: https://github.com/thegeez - -### License - -Copyright (c) 2012 Gijs Stuurman and released under an MIT license. diff --git a/clj-browserchannel-netty-adapter/project.clj b/clj-browserchannel-netty-adapter/project.clj deleted file mode 100644 index 35c61f0..0000000 --- a/clj-browserchannel-netty-adapter/project.clj +++ /dev/null @@ -1,6 +0,0 @@ -(defproject net.thegeez/clj-browserchannel-netty-adapter "0.0.1" - :description "Netty adapter for BrowserChannel through Aleph" - :dependencies [[org.clojure/clojure "1.3.0"] - [aleph "0.2.1-SNAPSHOT"] - [net.thegeez/clj-browserchannel-server "0.0.1"] - ]) diff --git a/clj-browserchannel-netty-adapter/src/net/thegeez/netty_adapter.clj b/clj-browserchannel-netty-adapter/src/net/thegeez/netty_adapter.clj deleted file mode 100644 index ae9846f..0000000 --- a/clj-browserchannel-netty-adapter/src/net/thegeez/netty_adapter.clj +++ /dev/null @@ -1,42 +0,0 @@ -(ns net.thegeez.netty-adapter - "BrowserChannel adapter for the Netty webserver" - (:require [aleph.http :as aleph] - [lamina.core :as l] - [net.thegeez.async-adapter :as async-adapter])) - - -(deftype NettyResponse [response-channel - body-channel] - async-adapter/IAsyncAdapter - (head [this status headers] - (l/enqueue response-channel - {:status status - :headers headers - :body body-channel})) - (write-chunk [this data] - (if (l/closed? body-channel) - (throw async-adapter/ConnectionClosedException) - (l/enqueue body-channel data))) - (close [this] - (l/close body-channel))) - - -(defn wrap-aleph-async-adapter [handler] - (fn [req] - (let [response-map (handler req)] - (condp = (:async response-map) - nil - ;; regular ring response - response-map - :http - (let [reactor (:reactor response-map) - response-channel (:channel req) - emit (NettyResponse. response-channel (l/channel))] - (reactor emit) - ;; this tells aleph to return nil as a ring handler - {:status 200 - ::ignore true}))))) - - -(defn run-netty [handler options] - (aleph/start-http-server (aleph/wrap-ring-handler (wrap-aleph-async-adapter handler)) options)) diff --git a/clj-browserchannel-netty-adapter/test/clj_browserchannel_netty_adapter/core_test.clj b/clj-browserchannel-netty-adapter/test/clj_browserchannel_netty_adapter/core_test.clj deleted file mode 100644 index 0513722..0000000 --- a/clj-browserchannel-netty-adapter/test/clj_browserchannel_netty_adapter/core_test.clj +++ /dev/null @@ -1,7 +0,0 @@ -(ns clj-browserchannel-netty-adapter.core-test - (:use clojure.test - clj-browserchannel-netty-adapter.core)) - -(deftest a-test - (testing "FIXME, I fail." - (is (= 0 1)))) \ No newline at end of file