Function codeMutex

  • Executes only one instance of give code at a time. If other calls come in in parallel, they get resolved to the result of the ongoing execution.

    Type Parameters

    • T

    Returns ((code) => Promise<T>)

      • (code): Promise<T>
      • Parameters

        Returns Promise<T>