Recipes

Shut down a controlled host

Stop new input, detach runtime hooks, drain accepted incidents, and end the manager lifecycle safely.

v0.1.0-dev.1Intermediateark_error_manager

Shut down a controlled host

Command-line processes, workers, desktop shells, embedded hosts, and tests can have a real teardown lifecycle.

Use this order:

  1. stop accepting feature input;
  2. detach isolate and Flutter bindings;
  3. call flush to await accepted incidents;
  4. close separately owned Reporter resources if required;
  5. call close on the manager.
dart
flutterBinding?.detach();
isolateBinding?.detach();
await manager.flush();
await manager.close();

Detach first so a global callback cannot submit work while the manager is closing. flush is synchronization and does not change lifecycle state; close is terminal.

After close, captureError returns false, while handleError completes with StateError.

ARKTELOS

Purpose-built engineering systems for software that has to hold.