Skip to content

Commit a6cbd48

Browse files
committed
Few adaptations and comments
1 parent 7132ff5 commit a6cbd48

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/aleph/http.clj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
| `control-period` | the interval, in milliseconds, between use of the controller to adjust the size of the pool, defaults to `60000`
104104
| `dns-options` | an optional map with async DNS resolver settings, for more information check `aleph.netty/dns-resolver-group`. When set, ignores `name-resolver` setting from `connection-options` in favor of shared DNS resolver instance
105105
| `middleware` | a function to modify request before sending, defaults to `aleph.http.client-middleware/wrap-request`
106+
| `pool-builder-fn` | a one arity function which returns a `io.aleph.dirigiste.IPool` from a map containing the following keys: `generate`, `destroy`, `control-period`, `max-queue-length` and `stats-callback`.
107+
| `pool-controller-builder-fn` | a zero arity function which returns a `io.aleph.dirigiste.IPool$Controller`.
106108
107109
the `connection-options` are a map describing behavior across all connections:
108110
@@ -136,17 +138,17 @@
136138
| `http-headers` | (HTTP proxy only) an optional map to set additional HTTP headers when establishing connection to the proxy server
137139
| `tunnel?` | (HTTP proxy only) if `true`, sends HTTP CONNECT to the proxy and waits for the 'HTTP/1.1 200 OK' response before sending any subsequent requests. Defaults to `false`. When using authorization or specifying additional headers uses tunneling disregarding this setting
138140
| `connection-timeout` | timeout in milliseconds for the tunnel become established, defaults to 60 seconds, setting is ignored when tunneling is not used."
139-
[{:keys [pool-builder-fn
140-
pool-controller-builder-fn
141-
connections-per-host
141+
[{:keys [connections-per-host
142142
total-connections
143143
target-utilization
144144
connection-options
145145
dns-options
146146
stats-callback
147147
control-period
148148
middleware
149-
max-queue-size]
149+
max-queue-size
150+
pool-builder-fn
151+
pool-controller-builder-fn]
150152
:or {connections-per-host 8
151153
total-connections 1024
152154
target-utilization 0.9
@@ -175,7 +177,7 @@
175177
create-pool-fn (or pool-builder-fn
176178
flow/instrumented-pool)
177179
create-pool-ctrl-fn (or pool-controller-builder-fn
178-
#(Pools/utilizationController %1 %2 %3))
180+
#(Pools/utilizationController target-utilization connections-per-host total-connections))
179181
pool (create-pool-fn
180182
{:generate (fn [host]
181183
(let [c (promise)
@@ -192,10 +194,7 @@
192194
client/close-connection))
193195
:control-period control-period
194196
:max-queue-size max-queue-size
195-
:controller (create-pool-ctrl-fn
196-
target-utilization
197-
connections-per-host
198-
total-connections)
197+
:controller (create-pool-ctrl-fn)
199198
:stats-callback stats-callback})]
200199
@(deliver p pool)))
201200

0 commit comments

Comments
 (0)