cleanupCompleters method

void cleanupCompleters(
  1. Entity typeEntity, {
  2. required Entity groupEntity,
})
inherited

Removes matching completers for typeEntity in groupEntity and bumps the registration epoch so any in-flight continuations re-wait instead of resolving against the now-gone registration.

Implementation

void cleanupCompleters(Entity typeEntity, {required Entity groupEntity}) {
  completersK[groupEntity]?.removeWhere((e) => e.typeEntity == typeEntity);
  final group = _epochsK[groupEntity] ??= {};
  group[typeEntity] = (group[typeEntity] ?? 0) + 1;
}