schedule method

void schedule(
  1. void callback()
)

Queues callback for the next flush, or runs it through the scheduler immediately when no batch is open.

Implementation

void schedule(void Function() callback) {
  if (_transactions > 0) {
    _queue.add(callback);
  } else {
    _scheduleFn(() => _notifyFn(callback));
  }
}