@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
41 lines (40 loc) • 1.82 kB
TypeScript
import { type Lock } from './lock.js';
import { type SoloListrTaskWrapper } from '../../types/index.js';
/**
* A utility class for managing lock acquisition tasks in Listr2 based workflows.
*/
export declare class ListrLock {
/**
* The default number of attempts to try acquiring the lock before failing.
*/
/**
* The title of the lock acquisition task used by Listr2.
*/
static readonly ACQUIRE_LOCK_TASK_TITLE: string;
/**
* Prevents instantiation of this utility class.
*/
private constructor();
/**
* Creates a new Listr2 task for acquiring a lock with retry logic.
* @param lock - the lock to be acquired.
* @param task - the parent task to which the lock acquisition task will be added.
* @returns a new Listr2 task for acquiring a lock with retry logic.
*/
static newAcquireLockTask(lock: Lock, task: SoloListrTaskWrapper<any>): import("listr2").Listr<any, any, any>;
/**
* Creates a new Listr2 task which always skips the acquisition of a lock.
* @param task - the parent task to which the lock acquisition task will be added.
* @returns a new Listr2 task which always skips the lock acquisition.
*/
static newSkippedLockTask(task: SoloListrTaskWrapper<object>): import("listr2").Listr<object, any, any>;
/**
* Acquires a lock with retry logic and appropriate Listr2 status updates. This method is called by the Listr2 task
* created by the newAcquireLeaseTask() method.
*
* @param lock - the lock to be acquired.
* @param task - the task to be updated with the lock acquisition status.
* @throws LockAcquisitionError if the lock could not be acquired after the maximum number of attempts or an unexpected error occurred.
*/
private static acquireWithRetry;
}