You're viewing archived documentation for @imqueue/rpc v1.17.1. APIs may differ from the current release. View the latest version ↗

lock() function

@lock() decorator implementation Will make all simultaneous similar method calls locked to be resolved with the first obtained values. Similarity is identified by a bypassed method argument values.

Signature:

export declare function lock(enabledOrOptions?: boolean | LockOptions): (target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;

Parameters

Parameter

Type

Description

enabledOrOptions

boolean | LockOptions

(Optional) whether to enable locks or not {( target: any, methodName: (string), descriptor: TypedPropertyDescriptor<(...args: any[]) => any> ) => void}

Returns:

(target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void