configureLinger method

void configureLinger({
  1. required Generator generator,
  2. required bool keepAlive,
})

Configure lingering for the given generator, according to keepAlive.

Implementation

void configureLinger({
  required final Generator generator,
  required final bool keepAlive,
}) {
  if (!keepAlive) {
    generator
      ..configDeleteBehavior(linger: true)
      ..destroy();
  }
}