forked from resilience4j/resilience4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue resilience4j#201 AdaptiveBulkhead states simplified (resilience…
- Loading branch information
Showing
15 changed files
with
523 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...4j-bulkhead/src/main/java/io/github/resilience4j/bulkhead/adaptive/internal/Activity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.github.resilience4j.bulkhead.adaptive.internal; | ||
|
||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
final class Activity { | ||
|
||
private final AtomicBoolean active = new AtomicBoolean(true); | ||
|
||
boolean isActive() { | ||
return active.get(); | ||
} | ||
|
||
boolean tryDeactivate() { | ||
return active.compareAndSet(true, false); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Activity{" + | ||
"active=" + active + | ||
'}'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.