deliver method

void deliver(
  1. TransportMessage message
)

Delivers message to every active subscription whose subject pattern matches.

Both broker wildcard styles are understood: */> (dot-separated) and +/# (slash-separated). > needs at least one trailing token, # also matches zero, exactly like the brokers.

Implementation

void deliver(TransportMessage message) {
  for (final registration in List.of(_registrations)) {
    if (registration.cancelled) continue;
    if (_matchesSubscription(registration.subject, message.subject)) {
      registration.onMessage(message);
    }
  }
}