outgoingMessageCount method

int outgoingMessageCount({
  1. int limit = 0,
})

Count the number of messages in the outgoing queue, i.e. those waiting to be sent to the server.

By default, counts all messages without any limitation. For a lower number pass a limit that's enough for your app logic.

Note: This call uses a (read) transaction internally:

  1. It's not just a "cheap" return of a single number. While this will still be fast, avoid calling this function excessively.
  2. The result follows transaction view semantics, thus it may not always match the actual value.

Implementation

int outgoingMessageCount({int limit = 0}) {
  final count = malloc<Uint64>();
  try {
    checkObx(C.sync_outgoing_message_count(_ptr, limit, count));
    return count.value;
  } finally {
    malloc.free(count);
  }
}