Quick update: diehard 0.2.2 released with circuit breaker support.

;; Define a circuit breaker with failure threshold:
;; it will be open when 35 executions in 50 failed
;; and it waits 1000ms to become half-open, and tests 50 executions to
;; see if failure is recovered

(diehard/defcircuitbreaker test-cb {:failure-threshold-ratio [35 50]
                                    :delay-ms 1000})

;; you code within `with-circuit-breaker` will be protected by this
;; circuit breaker `test-cb`
;; if it's open, the block will throw a
;; `net.jodah.failsafe.CircuitBreakerOpenException`
;; and fail fast without blocking.

(diehard/with-circuit-breaker test-cb
  ;; your protected code here
  )

For more information and issue reporting:

https://github.com/sunng87/diehard
https://sunng87.github.io/diehard/


On 07/04/2016 11:32 PM, Ning Sun wrote:
> That's already in progress:
> https://github.com/sunng87/diehard/pull/1
> 
> On 07/03/2016 02:21 AM, Janko Muzykant wrote:
>> Eagerly waiting for circuit-breaker wrapper :)
>>
>> cheers,
>> j.
>>
>>
>> Ning Sun <classicn...@gmail.com> writes:
>>
>>> Hi all,
>>>
>>> Just to announce the first release of diehard[1], a clojure wrapper over
>>> the Failsafe[2] library, which deals retry stuff for you.
>>>
>>> Diehard allows you to set retry criteria for any block a clojure code, like:
>>>
>>> (diehard/with-retry {:retry-on IOException}
>>>   (http/get "https://google.com";))
>>>
>>> The first release only has retry supported, more to come in next few
>>> versions.
>>>
>>> [1]: https://github.com/sunng87/diehard/
>>> [2]: https://github.com/jhalterman/failsafe
>>
> 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to