File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 148148 pool))
149149
150150(defn- ^Server create-server [options]
151- (let [server (Server. (create-threadpool options))]
151+ (let [pool (or (:thread-pool options) (create-threadpool options))
152+ server (Server. pool)]
152153 (when (:http? options true )
153154 (.addConnector server (http-connector server options)))
154155 (when (or (options :ssl? ) (options :ssl-port ))
189190 :key-password - the password to the keystore
190191 :keystore-scan-interval - if not nil, the interval in seconds to scan for an
191192 updated keystore
193+ :thread-pool - custom thread pool instance for Jetty to use
192194 :truststore - a truststore to use for SSL connections
193195 :trust-password - the password to the truststore
194196 :max-threads - the maximum number of threads to use (default 50)
Original file line number Diff line number Diff line change 290290 (is (= 1000 (. thread-pool getIdleTimeout)))
291291 (.stop server)))
292292
293+ (testing " providing custom thread-pool"
294+ (let [pool (QueuedThreadPool. )
295+ server (run-jetty hello-world {:port test-port
296+ :join? false
297+ :thread-pool pool})]
298+ (is (identical? pool (.getThreadPool server)))
299+ (.stop server)))
300+
293301 (testing " default character encoding"
294302 (with-server (content-type-handler " text/plain" ) {:port test-port}
295303 (let [response (http/get test-url)]
You can’t perform that action at this time.
0 commit comments