Skip to content

Commit

Permalink
feat: create-dispatcher public function
Browse files Browse the repository at this point in the history
  • Loading branch information
armed committed Jun 3, 2024
1 parent e4fe744 commit 85f0509
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/k16/ok_http.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
(defn- ->duration ^Duration [x]
(Duration/ofMillis x))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn create-dispatcher
^Dispatcher
[{:keys [executor-service idle-callback
max-requests max-requests-per-host]}]
(let [dispatcher (if executor-service
(Dispatcher. executor-service)
(Dispatcher.))]
(some->> idle-callback (.setIdleCallback dispatcher))
(some->> max-requests (.setMaxRequests dispatcher))
(some->> max-requests-per-host (.setMaxRequestsPerHost dispatcher))
dispatcher))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn create-connection-pool
^ConnectionPool
Expand Down

0 comments on commit 85f0509

Please sign in to comment.