[
https://issues.apache.org/jira/browse/LANG-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14580401#comment-14580401
]
Bruno P. Kinoshita commented on LANG-1085:
------------------------------------------
Hello Oliver!
Here's my first try: https://github.com/oheger/commons-lang/pull/1
+1 for renaming to EventCountCircuitBreaker. The JavaDocs are very
comprehensive as well, so by the class name + its JavaDocs I think it's easy to
tell what it is supposed to be.
While writing tests I noticed that the MemoryCircuitBreaker was simply looking
after a certain threshold, nothing related to memory (side note: the ES memory
circuit takes into consideration the unit [KB, MB, GB, etc]). So I've renamed
it too, to ThresholdCircuitBreaker.
I thought about changing to ? extends Number instead of Long, or something like
that, but comparing Double/Float can be tricky, and I thought we'd be
overcomplicating it for now.
Do you think it would be better to move the circuit breakers under its own
separate package, or do you think it's fine to use the concurrent one? Just
asking because with more implementations we may introduce new classes, and when
the first patch was created using that package, it didn't take several
implementations into consideration.
Thanks a lot and sorry for the late reply
Bruno
> Add a circuit breaker implementation
> ------------------------------------
>
> Key: LANG-1085
> URL: https://issues.apache.org/jira/browse/LANG-1085
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.concurrent.*
> Reporter: Oliver Heger
> Attachments: CircuitBreaker.java, CircuitBreakerTest.java
>
>
> A _circuit breaker_ is a useful component to protect an application against
> unreliable services or load peaks. A simple implementation could be a good
> fit for the concurrent package.
> A proposed implementation is attached. Feedback is welcome!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)