acquire method

WebSocketClient acquire()

Returns a client according to the pool strategy.

Prefers connected clients; falls back to any client if none are connected.

Implementation

WebSocketClient acquire() {
  if (_entries.isEmpty) throw StateError('WebSocketPool is empty');
  final entry = _pick();
  entry.useCount++;
  return entry.client;
}