basvandijk / concurrent-extra

Extra concurrency primitives
Other
17 stars 5 forks source link

Acquire lock with timeout #21

Open fintara opened 1 year ago

fintara commented 1 year ago

Similarly to Broadcast's listenTimeout, it may be useful to have:

that try to acquire the lock in the provided time or fail (returning False and Nothing correspondingly).

Is there a technical/logical limitation for this not to work? Is using timeout with acquire really undesirable?