onPause method
Called by pause. Returns true if successfully paused.
If false, the state is not changed.
Implementation
@override
Future<bool> onPause() async {
// stop the trigger executor so it don't trigger any more.
triggerExecutor?.pause();
// stop the task executor
taskExecutor?.pause();
return true;
}