Closed indeyets closed 5 years ago
Do you want a customizable timeout?
I don't
Do you want to wait for one tick of the event loop to try and acquire the lock, or do you want to immediately acquire the lock synchronously?
No preference, actually. Both are fine for me
Published tryAcquire
in 1.2.0: https://github.com/ide/await-lock/releases. See the code for documentation, though it's pretty straightforward.
I have a workflow, which would benefit if it were possible to try to get the lock and fail immediately if it is taken by other greenlet.
Would you take a patch implementing this?
There are 2 ways to implement this:
Promise<bool>
(true = success, false = failure)