pump method

void pump()

Sends one round of payloads now, without waiting for the timer.

Tests should drive the feed with this and leave tick long, rather than sleeping.

Implementation

void pump() {
  final FakeTransport? transport = _transport;
  if (transport == null || transport.isClosed) return;
  final int tick = _tick++;
  for (final SubscriptionKey key in _subscribed.toList(growable: false)) {
    final Object? payload = build(key, tick);
    if (payload == null) continue;
    transport.emit(
      jsonEncode(<String, Object?>{
        channelField: key.channel,
        ...key.args,
        dataField: payload,
      }),
    );
  }
}