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 148
148
pool))
149
149
150
150
(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)]
152
153
(when (:http? options true )
153
154
(.addConnector server (http-connector server options)))
154
155
(when (or (options :ssl? ) (options :ssl-port ))
189
190
:key-password - the password to the keystore
190
191
:keystore-scan-interval - if not nil, the interval in seconds to scan for an
191
192
updated keystore
193
+ :thread-pool - custom thread pool instance for Jetty to use
192
194
:truststore - a truststore to use for SSL connections
193
195
:trust-password - the password to the truststore
194
196
:max-threads - the maximum number of threads to use (default 50)
Original file line number Diff line number Diff line change 290
290
(is (= 1000 (. thread-pool getIdleTimeout)))
291
291
(.stop server)))
292
292
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
+
293
301
(testing " default character encoding"
294
302
(with-server (content-type-handler " text/plain" ) {:port test-port}
295
303
(let [response (http/get test-url)]
You can’t perform that action at this time.
0 commit comments