start method
Start the module's operation
Implementation
@override
Future<void> start() async {
if (_status != ModuleStatus.initialized &&
_status != ModuleStatus.stopped) {
throw ModuleException(
moduleId,
'Module must be initialized or stopped before starting',
);
}
try {
setStatus(ModuleStatus.starting);
await onStart();
setStatus(ModuleStatus.running);
} catch (e, stack) {
setStatus(ModuleStatus.error);
throw ModuleException(
moduleId,
'Failed to start',
cause: e,
stackTrace: stack,
);
}
}