const handleTag = (request, tag, options, context) => { if (tag && tag.name === 'switcher') { const stream = processTemplate(request, options, context); process.nextTick(() => { stream.end({ name: 'fragment', attributes: { src: 'http://localhost:8081' } }); }); return stream; } return ''; }
const deleteQueryBatch = async (db, query, batchSize, resolve, reject) => { const snapshot = await query.get(); // When there are no documents left, we are done if (snapshot.size === 0) { resolve(); return; } // Delete documents in a batch let batch = db.batch(); snapshot.docs.forEach(doc => { batch.delete(doc.ref); }); const batchSnapshot = await batch.commit(); const numDeleted = batchSnapshot.size; if (numDeleted === 0) { resolve(); return; } // Recurse on the next process tick, to avoid // exploding the stack. process.nextTick(() => { deleteQueryBatch(db, query, batchSize, resolve, reject); }); }
let childBehaviour = { initialize: (selfActor: Actor) => { process.nextTick(() => selfActor.getParent().send('forkedReady')); },
let childBehaviour = { initialize: (selfActor: Actor) => { process.nextTick(() => selfActor.getParent().send('forkedReady')); },