Create a mutex. Use this to run code that should not run in parallel.
const mutex = createMutex()async function runSomethingSequentially() { await mutex.acquire() try { // ... run something that should not run in parallel with other things } finally { mutex.release() }} Copy
const mutex = createMutex()async function runSomethingSequentially() { await mutex.acquire() try { // ... run something that should not run in parallel with other things } finally { mutex.release() }}
Create a mutex. Use this to run code that should not run in parallel.