onStart method

  1. @override
Future<bool> onStart()
override

Callback when this executor is started. Returns true if successfully started, false otherwise.

Implementation

@override
Future<bool> onStart() async {
  _stream ??= stream;
  if (_stream == null) {
    warning(
        "Trying to start the stream probe '$runtimeType' which does not provide a measurement stream. "
        'Have you initialized this probe correctly or is the device connected?');
    return false;
  } else {
    _subscription = _stream!.listen(onData, onError: onError, onDone: onDone);
  }
  return true;
}