cancel method

  1. @override
Future<void> cancel()
override

Cancel this gRPC call. Any remaining request objects will not be sent, and no further responses will be received.

Implementation

@override
Future<void> cancel() {
  if (!_responses.isClosed) {
    final error = GrpcError.cancelled('Cancelled by client.');
    _responses.addError(error);
    _finishTimelineWithError(error, _requestTimeline);
  }
  return _terminate();
}