durable-execution - v0.32.0
    Preparing search index...

    Function createMutex

    • Create a mutex, to run async callbacks one at a time

      Returns Mutex

      import { sleep, createMutex } from '@gpahal/std/promises'

      const mutex = createMutex()

      async function runSomethingSequentially() {
      await mutex.runExclusive(async () => {
      await sleep(100)
      })
      }