https://github.com/tessellator/resilience4clj-bulkhead
A small Clojure wrapper around the resilience4j Bulkhead module
https://github.com/tessellator/resilience4clj-bulkhead
bulkhead clojure resilience resilience4j
Last synced: about 2 months ago
JSON representation
A small Clojure wrapper around the resilience4j Bulkhead module
- Host: GitHub
- URL: https://github.com/tessellator/resilience4clj-bulkhead
- Owner: tessellator
- License: epl-2.0
- Created: 2020-02-20T03:21:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-20T05:53:13.000Z (over 5 years ago)
- Last Synced: 2025-07-06T14:06:23.860Z (3 months ago)
- Topics: bulkhead, clojure, resilience, resilience4j
- Language: Clojure
- Size: 12.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# resilience4clj-bulkhead
A small Clojure wrapper around the
[resilience4j Bulkhead module](https://resilience4j.readme.io/docs/bulkhead).
Requires Clojure 1.9 or later.[](https://clojars.org/tessellator/resilience4clj-bulkhead)
[](https://cljdoc.org/d/tessellator/resilience4clj-bulkhead/CURRENT)## Quick Start
The following code defines a function `make-remote-call` that will limit the
number of concurrent calls to an external service using a bulkhead named
`:my-bulkhead` in the global registry. If the bulkhead does not already exist in
the global registry, one is created.If a call would cause the bulkhead to exceed the maximum number of allowable
concurrent calls, that call will instead wait for permission to execute. If the
call does not receive permission to execute before a timeout period expires, an
exception will be thrown.```clojure
(ns myproject.some-client
(:require [clj-http.client :as http]
[resilience4clj.bulkhead :refer [with-bulkhead]])(defn make-remote-call []
(with-bulkhead :my-bulkhead
(http/get "https://www.example.com")))
```Refer to the [configuration guide](/doc/01_configuration.md) for more
information on how to configure the global registry as well as individual
bulkheads.Refer to the [usage guide](/doc/02_usage.md) for more information on how to
use bulkheads.## License
Copyright © 2020 Thomas C. Taylor and contributors.
Distributed under the Eclipse Public License version 2.0.