onResume method

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

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

Implementation

@override
Future<bool> onResume() async {
  Datum? datum;
  try {
    datum = await getDatum();
  } catch (error) {
    addError(error);
  }
  if (datum != null) addData(datum);
  // pause this probe automatically after a while
  Timer(Duration(seconds: 5), () => pause());
  return true;
}