onPause method

  1. @override
Future<bool> onPause()
inherited

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

Implementation

@override
Future<bool> onPause() async {
  await super.onPause();
  onSamplingEnd();
  try {
    Datum? datum = await getDatum();
    if (datum != null) addData(datum);
  } catch (error) {
    addError(error);
  }
  return true;
}