Skip to content

Commit 157301c

Browse files
committed
Simplify/clarify defaults
1 parent 9561052 commit 157301c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ When you start your app, add:
1212
(clj-http-hystrix.core/add-hook)
1313
```
1414

15-
Whenever you make an http request, add one or more of the hystrix-clj options to your options map:
15+
Whenever you make an http request, add **one or more** of the hystrix-clj options to your options map, e.g.:
1616

1717
```clj
1818
(http/get "http://www.google.com" {:hystrix/command-key :default
@@ -27,19 +27,13 @@ Whenever you make an http request, add one or more of the hystrix-clj options to
2727
:hystrix/bad-request-pred client-error?})
2828
```
2929

30-
Requests without any `:hystrix/...` keys won't use Hystrix. Any values not supplied will be set to their default values as above. Custom default values can also be specified when registering with `add-hook`:
30+
Requests without any `:hystrix/...` keys won't use Hystrix. If you include **at least one** `:hystrix/...` key then any keys not specified will take the above (default) values.
31+
32+
Custom default values can be specified when registering with `add-hook`. Any keys you supply will override the defaults shown above:
3133

3234
```clj
3335
(clj-http-hystrix.core/add-hook {:hystrix/timeout-ms 2500
3436
:hystrix/queue-size 12})
35-
36-
;; now each request will fallback to these if not supplied
37-
(http/get "http://www.google.com" {:hystrix/command-key :google})
38-
;;=> {:hystrix/command-key :google
39-
;; :hystrix/timeout-ms 2500
40-
;; :hystrix/queue-size 12
41-
;; ... (rest are clj-http-hystrix defaults)
42-
;; }
4337
```
4438

4539
## Bad requests

0 commit comments

Comments
 (0)