Skip to content
Browse files

make sure options propagate even when there's an executor

  • Loading branch information...
1 parent 380b088 commit 2909974c31d952bcbfe47ca1d2244c6b04d742a1 @ztellman committed Aug 29, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/aleph/http/netty.clj
View
10 src/aleph/http/netty.clj
@@ -10,6 +10,7 @@
(:use
[aleph.http.core]
[aleph netty formats]
+ [aleph.netty.core :only (local-options)]
[lamina core api connections trace executor])
(:require
[aleph.http.websocket :as ws]
@@ -65,13 +66,22 @@
error-probe (error-probe-channel [server-name :error])
channel-handler (server-generator
(fn [ch req]
+
+ ;; set local options
+ (.set local-options options)
+
(let [ch* (result-channel)]
+
+ ;; run the handler
(run-pipeline (dissoc req :keep-alive?)
{:error-handler #(error ch* %)}
#(handler ch* %))
+
+ ;; handle the response
(run-pipeline ch*
{:error-handler (fn [_])}
#(enqueue ch (assoc % :keep-alive? (:keep-alive? req))))))
+
(merge
{:error-response (fn [ex]
(enqueue error-probe ex)

0 comments on commit 2909974

Please sign in to comment.
Something went wrong with that request. Please try again.