post<T> method

  1. @override
Future<T> post<T>(
  1. Object message
)
override

Implementation

@override
Future<T> post<T>(Object message) async {
  if (closed) {
    throw _closeError ?? const ClosedException();
  }
  var completer = Completer<T>.sync();
  var id = _nextId++;
  handlers[id] = completer;
  final port = sendPort ?? await sendPortFuture;
  port.send(_RequestMessage(id, message, null));
  return await completer.future;
}