Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > ICobuildLockProvider

ICobuildLockProvider interface

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

export interface ICobuildLockProvider 

Methods

Method

Description

acquireLockAsync(context)

(BETA) The callback function to acquire a lock with a lock key and specific contexts.

NOTE: This lock implementation must be a ReentrantLock. It says the lock might be acquired multiple times, since tasks in the same cluster can be run in the same VM.

connectAsync()

(BETA) The callback function invoked to connect to the lock provider. For example, initializing the connection to the redis server.

disconnectAsync()

(BETA) The callback function invoked to disconnect the lock provider.

getCompletedStateAsync(context)

(BETA) The callback function to get completed state.

renewLockAsync(context)

(BETA) The callback function to renew a lock with a lock key and specific contexts.

NOTE: If the lock key expired

setCompletedStateAsync(context, state)

(BETA) The callback function to set completed state.