Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > ICobuildLockProvider > acquireLockAsync

ICobuildLockProvider.acquireLockAsync() method

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.

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.

Signature:

acquireLockAsync(context: Readonly<ICobuildContext>): Promise<boolean>;

Parameters

Parameter

Type

Description

context

Readonly<ICobuildContext>

Returns:

Promise<boolean>