add method

  1. @override
void add(
  1. Event event, {
  2. Iterable<String> channels = const [""],
})
override

Add a publication to the specified channels. By default, only adds to the default channel.

Implementation

@override
void add(Event event, {Iterable<String> channels: const [""]}) {
  for (String channel in channels) {
    List<ProxySink>? subs = _subsByChannel[channel];
    if (subs == null) {
      continue;
    }
    _logFiner(
        "Sending event on channel $channel to ${subs.length} subscribers.");
    for (var sub in subs) {
      sub.add(event);
    }
  }
  _cache?.add(event, channels);
}