hasMatchingSubscribers method

bool hasMatchingSubscribers()

Returns whether any subscribers currently match this publisher's key expression.

Implementation

bool hasMatchingSubscribers() {
  _ensureOpen();
  final loaned = bindings.zd_publisher_loan(_ptr.cast());
  final Pointer<Int> matching = calloc<Int>();
  try {
    final rc = bindings.zd_publisher_get_matching_status(loaned, matching);
    if (rc != 0) {
      throw ZenohException('Failed to get matching status', rc);
    }
    return matching.value != 0;
  } finally {
    calloc.free(matching);
  }
}