circuit_breaker

Creator: coderz1093

Last updated:

0 purchases

circuit_breaker Image
circuit_breaker Images

Languages

Categories

Add to Cart

Description:

circuit breaker

Circuit Breaker #



Using #
Create #
final http = Client();
final Request request = Request('POST', Uri.parse('http://example.com'));

final cb = CircuitBreaker(
request: request,
failureThreshold: 3,
successThreshold: 5,
timeout: Duration(seconds: 2));
copied to clipboard
Results #
await cb.execute()
.then((value){
print("Success breaker");
}).catchError((error, stack){
print("Fail breaker");
});
copied to clipboard
OR
// 2
final result = await cb.execute();
print(result.statusCode);
print(result.body);
print(result.state);
print(result.nextAttempt);
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.