Google is committed to advancing racial equity for Black communities. See how.

AsyncProxyController<T> constructor

AsyncProxyController<T>({String $serviceName, String $interfaceName})

Creates proxy controller.

Proxy controllers are not typically created directly. Instead, you typically obtain an AsyncProxyController<T> object as the AsyncProxy<T>.ctrl property of a TProxy object.

Implementation

AsyncProxyController({this.$serviceName, this.$interfaceName}) {
  _reader
    ..onReadable = _handleReadable
    ..onError = _handleError;
  whenClosed.then((_) {
    for (final Completer completer in _completerMap.values) {
      if (!completer.isCompleted) {
        completer.completeError(FidlError(
            'AsyncProxyController<${$interfaceName}> connection closed'));
      }
    }
    _completerMap.clear();
  }, onError: (_) {
    // Ignore errors.
  });
}