registerDrainable method

void registerDrainable(
  1. ZenithDrainable drainable
)

Registers drainable to be awaited during two-phase scope teardown.

Implementation

void registerDrainable(ZenithDrainable drainable) {
  if (_isDisposed || _isClosing) throw StateError('Scope is closing');
  _drainables.add(drainable);
}