VmService constructor

VmService(
  1. Stream inStream,
  2. void writeMessage(
    1. String message
    ), {
  3. Log? log,
  4. DisposeHandler? disposeHandler,
  5. Future? streamClosed,
  6. String? wsUri,
})

Implementation

VmService(
  Stream<dynamic> /*String|List<int>*/ inStream,
  void Function(String message) writeMessage, {
  Log? log,
  DisposeHandler? disposeHandler,
  Future? streamClosed,
  this.wsUri,
}) {
  _streamSub = inStream.listen(
    _processMessage,
    onDone: () async => await dispose(),
  );
  _writeMessage = writeMessage;
  _log = log ?? _NullLog();
  _disposeHandler = disposeHandler;
  streamClosed?.then((_) async => await dispose());
}