shutdown method
Implementation
Future<void> shutdown() async {
if (_root case final root?) {
_state = ServiceHostState.shutdown;
await _shutdownComponent(root);
_root = null;
_state = ServiceHostState.uninitialized;
} else {
throw ApiException('ServiceHost not initialized.');
}
}