run method

Future<void> run([
  1. CancellationToken? token
])

Runs an application and returns a Future that only completes when the token is triggered or shutdown is triggered.

Implementation

Future<void> run([
  CancellationToken? token,
]) async {
  token ??= CancellationToken.none;
  try {
    await start(token);
    await waitForShutdown(token);
  } finally {
    await disposeAsync();
  }
}