close method

Future<void> close({
  1. Duration gracePeriod = Duration.zero,
  2. bool interruptAfterGracePeriod = false,
})

Close the Runtime and dispose the event recorder.

Implementation

Future<void> close({
  Duration gracePeriod = Duration.zero,
  bool interruptAfterGracePeriod = false,
}) async {
  if (_closed) return;
  _closed = true;

  try {
    await runtime.close(
      gracePeriod: gracePeriod,
      interruptAfterGracePeriod: interruptAfterGracePeriod,
    );
  } finally {
    observer.dispose();
  }
}