You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
batch.begin('my_batch');// start (or reset) a named batchbatch.add('my_batch',()=>{// add a functionapplyDamage(player,5);});batch.add('my_batch',()=>{sendMessage(player,'ouch');});batch.flush('my_batch');// execute all, then clearbatch.cancel('my_batch');// discard without executing
add() calls begin() automatically if the batch doesn't exist yet.
Introspection
batch.size('my_batch');// number of pending functionsbatch.list();// → ['my_batch', ...]
Error handling
Errors thrown inside batched functions are caught and logged to console.error. Remaining functions in the batch continue to execute.