init method

Future<void> init(
  1. ZenStorage? storage
)

Initialize the queue and restore from storage if available.

If restored jobs exist, handlers are already registered, and the app is currently online, replay begins automatically.

Implementation

Future<void> init(ZenStorage? storage) async {
  _storage = storage;
  if (_storage != null) {
    await _restore();
    if (_queue.isNotEmpty &&
        _registry.isNotEmpty &&
        ZenQueryCache.instance.isOnline) {
      unawaited(process());
    }
  }
}