execute<T> method
Implementation
Future<T> execute<T>(Future<T> Function() operation) async {
if (_shouldReject()) {
throw Exception('Circuit breaker $name is open');
}
try {
final result = await operation();
_onSuccess();
return result;
} catch (e) {
_onFailure();
rethrow;
}
}