remove clj-browserchannel-netty-adapter
it was horribly out of date, didn't even build (broken dependencies), and when i briefly looked into fixing it up, i quickly realized that aleph/netty has changed quite a bit in the few years since this adapter was last touched. i really don't know anything about aleph/netty as i've never used it so i don't think it's a good idea for me to be trying to update this. ultimately i think removing this is the best option for now rather then keeping it around in a severly out of date and broken state.
This commit is contained in:
parent
7f67fbc352
commit
03c4abba20
|
@ -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.
|
|
|
@ -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"]
|
|
||||||
])
|
|
|
@ -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))
|
|
|
@ -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))))
|
|
Reference in a new issue