WebSocketPool constructor
WebSocketPool({
- required List<
WebSocketConfig> configs, - PoolStrategy strategy = PoolStrategy.roundRobin,
- WebSocketAdapter adapterFactory()?,
Implementation
WebSocketPool({
required List<WebSocketConfig> configs,
this.strategy = PoolStrategy.roundRobin,
/// Optional factory to create adapters; defaults to [WebSocketChannelAdapter].
WebSocketAdapter Function(WebSocketConfig)? adapterFactory,
}) : _entries = configs.map((c) {
final adapter =
adapterFactory?.call(c) ?? WebSocketChannelAdapter(c);
return _PoolEntry(WebSocketClient(adapter));
}).toList();