queueCall method

Future<void> queueCall(
  1. OdooRpcCall call, {
  2. bool awaited = false,
})

Puts rpcCall to calls queue that will be processed when online

Implementation

Future<void> queueCall(OdooRpcCall call, {bool awaited = false}) async {
  var calls = await pendingCalls;
  await callsLock.protectWrite(() async {
    calls.add(call);
    await cache.put(pendingCallsKey, calls);
  });
  if (await netConnectivity.checkNetConn() == netConnState.online) {
    if (awaited) {
      return await _processCallQueue();
    }
    unawaited(_processCallQueue());
  }
}