iya-sts
    Preparing search index...

    Variable withLease

    withLease: (name: any, fn: any) => any = withLease

    Type Declaration

      • (name: any, fn: any): any
      • Runs fn with a lease held, every transaction it opens fenced by the lease's token.

        Parameters

        • name: any

          the lease's name

        • fn: any

          the work to run

        Returns any

        a promise of { held: true, result }, or { held: false, holder } without running fn when another node holds the lease