MCPcopy Index your code
hub / github.com/apache/pouchdb / processPendingBatch

Function processPendingBatch

lib/index.es.js:9977–10007  ·  view source on GitHub ↗
(immediate)

Source from the content-addressed store, hash-verified

9975
9976
9977 function processPendingBatch(immediate) {
9978 if (pendingBatch.changes.length === 0) {
9979 if (batches.length === 0 && !currentBatch) {
9980 if ((continuous && changesOpts.live) || changesCompleted) {
9981 returnValue.state = 'pending';
9982 returnValue.emit('paused');
9983 }
9984 if (changesCompleted) {
9985 completeReplication();
9986 }
9987 }
9988 return;
9989 }
9990 if (
9991 immediate ||
9992 changesCompleted ||
9993 pendingBatch.changes.length >= batch_size
9994 ) {
9995 batches.push(pendingBatch);
9996 pendingBatch = {
9997 seq: 0,
9998 changes: [],
9999 docs: []
10000 };
10001 if (returnValue.state === 'pending' || returnValue.state === 'stopped') {
10002 returnValue.state = 'active';
10003 returnValue.emit('active');
10004 }
10005 startNextBatch();
10006 }
10007 }
10008
10009
10010 function abortReplication(reason, err) {

Callers 4

startNextBatchFunction · 0.70
onChangeFunction · 0.70
onChangesCompleteFunction · 0.70
completeFunction · 0.70

Calls 2

completeReplicationFunction · 0.70
startNextBatchFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…