process method
Implementation
@override
Future<dynamic> process(
String method,
List<dynamic>? params,
Future<dynamic> Function(String method, List<dynamic>? params) next,
) async {
Object? lastError;
for (var attempt = 0; attempt <= maxRetries; attempt++) {
try {
return await next(method, params);
} catch (e) {
lastError = e;
if (attempt < maxRetries) {
await Future<void>.delayed(retryDelay * (attempt + 1));
}
}
}
throw lastError!;
}