call method
- C request
Implementation
Future<R> call(C request) {
final call = ServiceCall(request, Completer<R>());
_callQueue.add(call);
if (maxQueueSize > 0 && _callQueue.length > maxQueueSize) {
final call = _callQueue.removeAt(0);
call.completer.completeError(
'Unable to complete service call because of queue limitations');
}
if (_callQueue.length == 1 && _currentCall == null) {
_executeCall();
}
return call.completer.future;
}