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 const ClosedException();
  }
  var completer = Completer<T>.sync();
  var id = _nextId++;
  handlers[id] = completer;
  sendPort.send(_RequestMessage(id, message, receivePort.sendPort));
  return await completer.future;
}