discard method

Future<bool> discard(
  1. String connectionId, [
  2. Object? reason
])

Discards and closes an active or pending connection.

Implementation

Future<bool> discard(String connectionId, [Object? reason]) async {
  final AcpServerConnectionState? state =
      _active.remove(connectionId) ?? _pending.remove(connectionId);
  if (state == null) {
    return false;
  }
  await state.close(reason);
  return true;
}