Optional
execution_How long can a job be executing before timing out. Null to disable timeout. If you do that, though, and you have a swallowed callback, the lock can remain locked permanently.
Optional
extend_In any error produced by BetterLock, extend the stack trace to include incoming trace. Defaults to true.
Optional
logWhether to log the internal actions. Set to true to use console.log. Alternatively, provide your own function
Optional
nameLock name. This will be written in all logs and error messages, to help you distinguish between different locks
Optional
queue_If queue is full, which job to eject. Defaults to 'oldest'.
Optional
queue_Max queue size for waiting jobs.
Optional
wait_How long can jobs wait in queue before timing out. Null to disable timeout.
Optional
lock_Before acquiring lock, call this function with the given key. If condition is rejected, the executor is immediately called, without locking. This can be used to more conveniently opt out of locking, without duplicating or extracting the executor.
Optional
promise_Function that detects whether value returned by executor is a promise. This will ducktype-sniff the returned value. Depending on your Promise library of choice, you might want to tighten or loosen this bit.
Generated using TypeDoc
Options that apply on BetterLock instance