Optionaloptions: UdpBindLockOptionsAcquires the lock, waiting if necessary until it is available.
Optionalsignal: AbortSignal | nullAn optional AbortSignal to cancel the acquire operation.
A promise that resolves when the lock is acquired.
Attempts to acquire the lock without waiting.
True if the lock was successfully acquired, false otherwise.
Releases the lock.
A class that provides a mechanism to ensure that only one instance of a process is running at a time by attempting to bind to a specific UDP port.
This is useful for preventing multiple instances of a script or application from running simultaneously.
Note: The lock is automatically released when the process exits, but it is recommended to call
releaseexplicitly when the lock is no longer needed.Example usage: