better-lock 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/better_lock.d.ts +13 -7
- package/dist/better_lock.js +55 -1
- package/dist/better_lock.js.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +7 -1
- package/dist/errors.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/BetterLockError.html +3 -3
- package/docs/classes/BetterLockExecutionTimeoutError.html +6 -6
- package/docs/classes/BetterLockInternalError.html +3 -3
- package/docs/classes/BetterLockInvalidArgumentError.html +4 -4
- package/docs/classes/BetterLockJobAbortedError.html +5 -5
- package/docs/classes/BetterLockQueueOverflowError.html +8 -8
- package/docs/classes/BetterLockWaitTimeoutError.html +6 -6
- package/docs/classes/_internal_.BetterLock.html +189 -7
- package/docs/classes/_internal_.KeyQueue.html +4 -4
- package/docs/classes/_internal_.LockJob.html +13 -13
- package/docs/functions/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.isAcquisitionFailureError.html +62 -0
- package/docs/index.html +13 -2
- package/docs/interfaces/BetterLockJobOptions.html +27 -4
- package/docs/interfaces/BetterLockOptions.html +26 -8
- package/docs/modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html +6 -1
- package/docs/types/BetterLockErrorName.html +1 -1
- package/docs/types/BetterLockExecutor.html +1 -1
- package/docs/types/BetterLockKey.html +1 -1
- package/docs/types/BetterLockQueueEjectionStrategy.html +1 -1
- package/docs/types/_internal_.ICallback.html +1 -1
- package/docs/types/_internal_.ICallbackExecutor.html +1 -1
- package/docs/types/_internal_.IErrorExports.html +1 -1
- package/docs/types/_internal_.IPromiseExecutor.html +1 -1
- package/docs/variables/BetterLock.html +1 -1
- package/package.json +1 -1
- package/spec/better_lock.spec.ts +100 -0
- package/src/better_lock.ts +89 -8
- package/src/errors.ts +14 -1
- package/src/types.ts +5 -0
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<div class="tsd-comment tsd-typography"><p>Active job that is holding this key. This job could be waiting on other keys or executing.</p>
|
|
64
64
|
</div><aside class="tsd-sources">
|
|
65
65
|
<ul>
|
|
66
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
66
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L109">internals.ts:109</a></li></ul></aside></section>
|
|
67
67
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="jobs" class="tsd-anchor"></a>
|
|
68
68
|
<h3 class="tsd-anchor-link"><span>jobs</span><a href="#jobs" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
69
69
|
<div class="tsd-signature">jobs<span class="tsd-signature-symbol">:</span> <a href="_internal_.LockJob.html" class="tsd-signature-type" data-tsd-kind="Class">LockJob</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div>
|
|
@@ -71,17 +71,17 @@
|
|
|
71
71
|
Jobs in this state are governed by the wait_timeout.</p>
|
|
72
72
|
</div><aside class="tsd-sources">
|
|
73
73
|
<ul>
|
|
74
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
74
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L104">internals.ts:104</a></li></ul></aside></section>
|
|
75
75
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="key" class="tsd-anchor"></a>
|
|
76
76
|
<h3 class="tsd-anchor-link"><span>key</span><a href="#key" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
77
77
|
<div class="tsd-signature">key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
78
78
|
<ul>
|
|
79
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
79
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L98">internals.ts:98</a></li></ul></aside></section>
|
|
80
80
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="DEFAULT_QUEUE_KEY" class="tsd-anchor"></a>
|
|
81
81
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>DEFAULT_<wbr/>QUEUE_<wbr/>KEY</span><a href="#DEFAULT_QUEUE_KEY" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
82
82
|
<div class="tsd-signature">DEFAULT_<wbr/>QUEUE_<wbr/>KEY<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"___DEFAULT_QUEUE_KEY___"</span><span class="tsd-signature-symbol"> = '___DEFAULT_QUEUE_KEY___'</span></div><aside class="tsd-sources">
|
|
83
83
|
<ul>
|
|
84
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
84
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L96">internals.ts:96</a></li></ul></aside></section></section>
|
|
85
85
|
<section class="tsd-panel-group tsd-member-group">
|
|
86
86
|
<h2>Methods</h2>
|
|
87
87
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toString" class="tsd-anchor"></a>
|
|
@@ -89,89 +89,89 @@
|
|
|
89
89
|
This is supplied by user in callback API, and generated internally otherwise.</p>
|
|
90
90
|
</div><aside class="tsd-sources">
|
|
91
91
|
<ul>
|
|
92
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
92
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L32">internals.ts:32</a></li></ul></aside></section>
|
|
93
93
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="ended_at" class="tsd-anchor"></a>
|
|
94
94
|
<h3 class="tsd-anchor-link"><span>ended_<wbr/>at</span><a href="#ended_at" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
95
95
|
<div class="tsd-signature">ended_<wbr/>at<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol"> = null</span></div>
|
|
96
96
|
<div class="tsd-comment tsd-typography"><p>This is set when job ends, in case something holds a reference to it</p>
|
|
97
97
|
</div><aside class="tsd-sources">
|
|
98
98
|
<ul>
|
|
99
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
99
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L47">internals.ts:47</a></li></ul></aside></section>
|
|
100
100
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="enqueued_at" class="tsd-anchor"></a>
|
|
101
101
|
<h3 class="tsd-anchor-link"><span>enqueued_<wbr/>at</span><a href="#enqueued_at" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
102
102
|
<div class="tsd-signature">enqueued_<wbr/>at<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol"> = ...</span></div>
|
|
103
103
|
<div class="tsd-comment tsd-typography"><p>Timestamp when job was created</p>
|
|
104
104
|
</div><aside class="tsd-sources">
|
|
105
105
|
<ul>
|
|
106
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
106
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L37">internals.ts:37</a></li></ul></aside></section>
|
|
107
107
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="executed_at" class="tsd-anchor"></a>
|
|
108
108
|
<h3 class="tsd-anchor-link"><span>executed_<wbr/>at</span><a href="#executed_at" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
109
109
|
<div class="tsd-signature">executed_<wbr/>at<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Date</span><span class="tsd-signature-symbol"> = null</span></div>
|
|
110
110
|
<div class="tsd-comment tsd-typography"><p>Timestamp when job was executed</p>
|
|
111
111
|
</div><aside class="tsd-sources">
|
|
112
112
|
<ul>
|
|
113
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
113
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L42">internals.ts:42</a></li></ul></aside></section>
|
|
114
114
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="execution_timeout_id" class="tsd-anchor"></a>
|
|
115
115
|
<h3 class="tsd-anchor-link"><span>execution_<wbr/>timeout_<wbr/>id</span><a href="#execution_timeout_id" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
116
116
|
<div class="tsd-signature">execution_<wbr/>timeout_<wbr/>id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = null</span></div>
|
|
117
117
|
<div class="tsd-comment tsd-typography"><p>Id of the execution timer</p>
|
|
118
118
|
</div><aside class="tsd-sources">
|
|
119
119
|
<ul>
|
|
120
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
120
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L62">internals.ts:62</a></li></ul></aside></section>
|
|
121
121
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="executor" class="tsd-anchor"></a>
|
|
122
122
|
<h3 class="tsd-anchor-link"><span>executor</span><a href="#executor" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
123
123
|
<div class="tsd-signature">executor<span class="tsd-signature-symbol">:</span> <a href="../types/BetterLockExecutor.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockExecutor</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">TResult</span><span class="tsd-signature-symbol">></span></div>
|
|
124
124
|
<div class="tsd-comment tsd-typography"><p>Function that will be called inside the lock</p>
|
|
125
125
|
</div><aside class="tsd-sources">
|
|
126
126
|
<ul>
|
|
127
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
127
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L26">internals.ts:26</a></li></ul></aside></section>
|
|
128
128
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="id" class="tsd-anchor"></a>
|
|
129
129
|
<h3 class="tsd-anchor-link"><span>id</span><a href="#id" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
130
130
|
<div class="tsd-signature">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = undefined</span></div>
|
|
131
131
|
<div class="tsd-comment tsd-typography"><p>ID to uniquely identify this particular job</p>
|
|
132
132
|
</div><aside class="tsd-sources">
|
|
133
133
|
<ul>
|
|
134
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
134
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L11">internals.ts:11</a></li></ul></aside></section>
|
|
135
135
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="incoming_stack" class="tsd-anchor"></a>
|
|
136
136
|
<h3 class="tsd-anchor-link"><span>incoming_<wbr/>stack</span><a href="#incoming_stack" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
137
137
|
<div class="tsd-signature">incoming_<wbr/>stack<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = null</span></div>
|
|
138
138
|
<div class="tsd-comment tsd-typography"><p>Saved incoming stack, for the purpose of extending stack traces</p>
|
|
139
139
|
</div><aside class="tsd-sources">
|
|
140
140
|
<ul>
|
|
141
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
141
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L67">internals.ts:67</a></li></ul></aside></section>
|
|
142
142
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="keys" class="tsd-anchor"></a>
|
|
143
143
|
<h3 class="tsd-anchor-link"><span>keys</span><a href="#keys" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
144
144
|
<div class="tsd-signature">keys<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
|
|
145
145
|
<div class="tsd-comment tsd-typography"><p>List of keys that will be locked. Always an array</p>
|
|
146
146
|
</div><aside class="tsd-sources">
|
|
147
147
|
<ul>
|
|
148
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
148
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L16">internals.ts:16</a></li></ul></aside></section>
|
|
149
149
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="options" class="tsd-anchor"></a>
|
|
150
150
|
<h3 class="tsd-anchor-link"><span>options</span><a href="#options" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
151
151
|
<div class="tsd-signature">options<span class="tsd-signature-symbol">:</span> <a href="../interfaces/BetterLockJobOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BetterLockJobOptions</a></div>
|
|
152
152
|
<div class="tsd-comment tsd-typography"><p>Options that apply to this particular job</p>
|
|
153
153
|
</div><aside class="tsd-sources">
|
|
154
154
|
<ul>
|
|
155
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
155
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L52">internals.ts:52</a></li></ul></aside></section>
|
|
156
156
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="wait_timeout_id" class="tsd-anchor"></a>
|
|
157
157
|
<h3 class="tsd-anchor-link"><span>wait_<wbr/>timeout_<wbr/>id</span><a href="#wait_timeout_id" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
158
158
|
<div class="tsd-signature">wait_<wbr/>timeout_<wbr/>id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = null</span></div>
|
|
159
159
|
<div class="tsd-comment tsd-typography"><p>Id of the wait timer</p>
|
|
160
160
|
</div><aside class="tsd-sources">
|
|
161
161
|
<ul>
|
|
162
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
162
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L57">internals.ts:57</a></li></ul></aside></section>
|
|
163
163
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="waiting_count" class="tsd-anchor"></a>
|
|
164
164
|
<h3 class="tsd-anchor-link"><span>waiting_<wbr/>count</span><a href="#waiting_count" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
165
165
|
<div class="tsd-signature">waiting_<wbr/>count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
166
166
|
<div class="tsd-comment tsd-typography"><p>Number of keys which this job is waiting on. Once this reaches 0, job will be executed</p>
|
|
167
167
|
</div><aside class="tsd-sources">
|
|
168
168
|
<ul>
|
|
169
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
169
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L21">internals.ts:21</a></li></ul></aside></section>
|
|
170
170
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="_lastId" class="tsd-anchor"></a>
|
|
171
171
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>_last<wbr/>Id</span><a href="#_lastId" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
172
172
|
<div class="tsd-signature">_last<wbr/>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div><aside class="tsd-sources">
|
|
173
173
|
<ul>
|
|
174
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
174
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/internals.ts#L8">internals.ts:8</a></li></ul></aside></section></section>
|
|
175
175
|
<section class="tsd-panel-group tsd-member-group">
|
|
176
176
|
<h2>Methods</h2>
|
|
177
177
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toString" class="tsd-anchor"></a>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>isAcquisitionFailureError | better-lock</title><meta name="description" content="Documentation for better-lock"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
+
<div class="tsd-toolbar-contents container">
|
|
3
|
+
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
+
<div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
+
<ul class="results">
|
|
6
|
+
<li class="state loading">Preparing search index...</li>
|
|
7
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">better-lock</a></div>
|
|
8
|
+
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
9
|
+
<div class="container container-main">
|
|
10
|
+
<div class="col-8 col-content">
|
|
11
|
+
<div class="tsd-page-title">
|
|
12
|
+
<ul class="tsd-breadcrumb">
|
|
13
|
+
<li><a href="../modules.html">better-lock</a></li>
|
|
14
|
+
<li><a href="../modules/_internal_.html"><internal></a></li>
|
|
15
|
+
<li><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html">"/home/panta/dev/pantas/better-lock/src/errors"</a></li>
|
|
16
|
+
<li><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.isAcquisitionFailureError.html">isAcquisitionFailureError</a></li></ul>
|
|
17
|
+
<h1>Function isAcquisitionFailureError</h1></div>
|
|
18
|
+
<section class="tsd-panel">
|
|
19
|
+
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-namespace">
|
|
20
|
+
<li class="tsd-signature" id="isAcquisitionFailureError">is<wbr/>Acquisition<wbr/>Failure<wbr/>Error<span class="tsd-signature-symbol">(</span>err<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul>
|
|
21
|
+
<ul class="tsd-descriptions">
|
|
22
|
+
<li class="tsd-description">
|
|
23
|
+
<div class="tsd-parameters">
|
|
24
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
25
|
+
<ul class="tsd-parameter-list">
|
|
26
|
+
<li>
|
|
27
|
+
<h5>err: <span class="tsd-signature-type">any</span></h5></li></ul></div>
|
|
28
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></div>
|
|
29
|
+
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
30
|
+
<div class="tsd-navigation settings">
|
|
31
|
+
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
32
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
33
|
+
<div class="tsd-accordion-details">
|
|
34
|
+
<div class="tsd-filter-visibility">
|
|
35
|
+
<h4 class="uppercase">Member Visibility</h4><form>
|
|
36
|
+
<ul id="tsd-filter-options">
|
|
37
|
+
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div>
|
|
38
|
+
<div class="tsd-theme-toggle">
|
|
39
|
+
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
40
|
+
<nav class="tsd-navigation primary">
|
|
41
|
+
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
42
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
43
|
+
<div class="tsd-accordion-details">
|
|
44
|
+
<ul>
|
|
45
|
+
<li class="current"><a href="../modules.html">better-<wbr/>lock</a>
|
|
46
|
+
<ul>
|
|
47
|
+
<li class="current tsd-kind-namespace"><a href="../modules/_internal_.html"><internal></a>
|
|
48
|
+
<ul>
|
|
49
|
+
<li class="current tsd-kind-namespace tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html">"/home/panta/dev/pantas/better-<wbr/>lock/src/errors"</a></li></ul></li></ul></li></ul></div></details></nav>
|
|
50
|
+
<nav class="tsd-navigation secondary menu-sticky">
|
|
51
|
+
<ul>
|
|
52
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-8388608-path"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)" id="icon-8388608-text"></path></svg>Better<wbr/>Lock<wbr/>Error</a></li>
|
|
53
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockExecutionTimeoutError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Execution<wbr/>Timeout<wbr/>Error</a></li>
|
|
54
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockInternalError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Internal<wbr/>Error</a></li>
|
|
55
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockInvalidArgumentError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Invalid<wbr/>Argument<wbr/>Error</a></li>
|
|
56
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockJobAbortedError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Job<wbr/>Aborted<wbr/>Error</a></li>
|
|
57
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockQueueOverflowError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Queue<wbr/>Overflow<wbr/>Error</a></li>
|
|
58
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="../modules/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockWaitTimeoutError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Wait<wbr/>Timeout<wbr/>Error</a></li>
|
|
59
|
+
<li class="current tsd-kind-function tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.isAcquisitionFailureError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>is<wbr/>Acquisition<wbr/>Failure<wbr/>Error</a></li></ul></nav></div></div>
|
|
60
|
+
<div class="container tsd-generator">
|
|
61
|
+
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
62
|
+
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
package/docs/index.html
CHANGED
|
@@ -87,6 +87,9 @@
|
|
|
87
87
|
<li><code>jobOptions</code>: An object that should match interface <code>BetterLockJobOptions</code>. A subset of main options that will serve as overrides for this particular job (for example, timeout settings).</li>
|
|
88
88
|
</ul>
|
|
89
89
|
</li>
|
|
90
|
+
<li><p><code>BetterLock.acquireOr([key], failureResult, executor, [callback], [jobOptions])</code><br>The same as acquire, except if the lock can't be acquired (the executor never gets called), instead of throwing
|
|
91
|
+
an error, the lock will resolve/callback with the provided failureResult value (for example, a <code>null</code>).</p>
|
|
92
|
+
</li>
|
|
90
93
|
<li><p><code>BetterLock.canAcquire([key])</code><br>Returns true if given key can be acquired.</p>
|
|
91
94
|
</li>
|
|
92
95
|
<li><p><code>BetterLock.abort([key])</code><br>Abort all jobs for a given key (or from the default job queue, if no key is given). Job executors will not be called. Callbacks will be called with <code>JobAbortedError</code>. Currently executing job will not be interrupted.</p>
|
|
@@ -112,8 +115,6 @@ If you do that, though, and you have a swallowed callback, the lock can remain l
|
|
|
112
115
|
</li>
|
|
113
116
|
<li><p><code>queue_size</code><br>Max queue size for waiting jobs.</p>
|
|
114
117
|
</li>
|
|
115
|
-
<li><p><code>queue_ejection_strategy</code><br>Which job to eject from the queue when it's full. Default is <code>newest</code>.</p>
|
|
116
|
-
</li>
|
|
117
118
|
</ul>
|
|
118
119
|
<p>Default options are a static member <code>DEFAULT_OPTIONS</code> on the <code>BetterLock</code> class. During runtime, you can change the defaults like this:</p>
|
|
119
120
|
<pre><code class="language-javascript"><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-6">BetterLock</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-7">'better-lock'</span><span class="hl-0">;</span><br/><br/><span class="hl-6">BetterLock</span><span class="hl-0">.</span><span class="hl-3">DEFAULT_OPTIONS</span><span class="hl-0">.</span><span class="hl-6">wait_timeout</span><span class="hl-0"> = </span><span class="hl-8">1000</span><span class="hl-0">;</span>
|
|
@@ -141,6 +142,16 @@ If you do that, though, and you have a swallowed callback, the lock can remain l
|
|
|
141
142
|
<h3>Change log</h3>
|
|
142
143
|
</a>
|
|
143
144
|
|
|
145
|
+
<a href="#320-20240621" id="320-20240621" style="color: inherit; text-decoration: none;">
|
|
146
|
+
<h4><strong>3.2.0</strong> (<em>2024/06/21</em>)</h4>
|
|
147
|
+
</a>
|
|
148
|
+
<p>Add new api <code>canAcquire</code>. A helper for "best effort" lock acquisition.</p>
|
|
149
|
+
|
|
150
|
+
<a href="#310-20240621" id="310-20240621" style="color: inherit; text-decoration: none;">
|
|
151
|
+
<h4><strong>3.1.0</strong> (<em>2024/06/21</em>)</h4>
|
|
152
|
+
</a>
|
|
153
|
+
<p>Add option <code>lock_condition</code>.</p>
|
|
154
|
+
|
|
144
155
|
<a href="#300-20240418" id="300-20240418" style="color: inherit; text-decoration: none;">
|
|
145
156
|
<h4><strong>3.0.0</strong> (<em>2024/04/18</em>)</h4>
|
|
146
157
|
</a>
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
<div class="tsd-index-list"><a href="BetterLockJobOptions.html#execution_timeout" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-1024-path"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)" id="icon-1024-text"></path></svg><span>execution_<wbr/>timeout</span></a>
|
|
33
33
|
<a href="BetterLockJobOptions.html#extend_stack_traces" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>extend_<wbr/>stack_<wbr/>traces</span></a>
|
|
34
34
|
<a href="BetterLockJobOptions.html#wait_timeout" class="tsd-index-link tsd-kind-property tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg><span>wait_<wbr/>timeout</span></a>
|
|
35
|
+
</div></section>
|
|
36
|
+
<section class="tsd-index-section">
|
|
37
|
+
<h3 class="tsd-index-heading">Methods</h3>
|
|
38
|
+
<div class="tsd-index-list"><a href="BetterLockJobOptions.html#lock_condition" class="tsd-index-link tsd-kind-method tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-2048-path"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)" id="icon-2048-text"></path></svg><span>lock_<wbr/>condition</span></a>
|
|
35
39
|
</div></section></div></details></section></section>
|
|
36
40
|
<section class="tsd-panel-group tsd-member-group">
|
|
37
41
|
<h2>Properties</h2>
|
|
@@ -41,21 +45,39 @@
|
|
|
41
45
|
<div class="tsd-comment tsd-typography"><p>How long can a job be executing before timing out. Null to disable timeout. Overrides BetterLockOptions value.</p>
|
|
42
46
|
</div><aside class="tsd-sources">
|
|
43
47
|
<ul>
|
|
44
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
48
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L15">options.ts:15</a></li></ul></aside></section>
|
|
45
49
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="extend_stack_traces" class="tsd-anchor"></a>
|
|
46
50
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>extend_<wbr/>stack_<wbr/>traces</span><a href="#extend_stack_traces" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
47
51
|
<div class="tsd-signature">extend_<wbr/>stack_<wbr/>traces<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
48
52
|
<div class="tsd-comment tsd-typography"><p>In any error produced by BetterLock, extend the stack trace to include incoming trace. Overrides BetterLockOptions value.</p>
|
|
49
53
|
</div><aside class="tsd-sources">
|
|
50
54
|
<ul>
|
|
51
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
55
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L20">options.ts:20</a></li></ul></aside></section>
|
|
52
56
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="wait_timeout" class="tsd-anchor"></a>
|
|
53
57
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>wait_<wbr/>timeout</span><a href="#wait_timeout" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
54
58
|
<div class="tsd-signature">wait_<wbr/>timeout<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div>
|
|
55
59
|
<div class="tsd-comment tsd-typography"><p>How long can jobs wait in queue before timing out. Overrides BetterLockOptions value.</p>
|
|
56
60
|
</div><aside class="tsd-sources">
|
|
57
61
|
<ul>
|
|
58
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
62
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L10">options.ts:10</a></li></ul></aside></section></section>
|
|
63
|
+
<section class="tsd-panel-group tsd-member-group">
|
|
64
|
+
<h2>Methods</h2>
|
|
65
|
+
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="lock_condition" class="tsd-anchor"></a>
|
|
66
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>lock_<wbr/>condition</span><a href="#lock_condition" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
67
|
+
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
68
|
+
<li class="tsd-signature" id="lock_condition.lock_condition-1">lock_<wbr/>condition<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol"> | </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul>
|
|
69
|
+
<ul class="tsd-descriptions">
|
|
70
|
+
<li class="tsd-description">
|
|
71
|
+
<div class="tsd-comment tsd-typography"><p>Before acquiring lock, call this function with the given key. If condition is rejected, the executor is immediately called, without locking.
|
|
72
|
+
This can be used to more conveniently opt out of locking, without duplicating or extracting the executor.
|
|
73
|
+
Overrides BetterLockOptions value.</p>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="tsd-parameters">
|
|
76
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
77
|
+
<ul class="tsd-parameter-list">
|
|
78
|
+
<li>
|
|
79
|
+
<h5>key: <a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol"> | </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
|
|
80
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></section></div>
|
|
59
81
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
60
82
|
<div class="tsd-navigation settings">
|
|
61
83
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -83,7 +105,8 @@
|
|
|
83
105
|
<ul>
|
|
84
106
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockJobOptions.html#execution_timeout" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>execution_<wbr/>timeout</a></li>
|
|
85
107
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockJobOptions.html#extend_stack_traces" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>extend_<wbr/>stack_<wbr/>traces</a></li>
|
|
86
|
-
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockJobOptions.html#wait_timeout" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>wait_<wbr/>timeout</a></li
|
|
108
|
+
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockJobOptions.html#wait_timeout" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>wait_<wbr/>timeout</a></li>
|
|
109
|
+
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="BetterLockJobOptions.html#lock_condition" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>lock_<wbr/>condition</a></li></ul></li></ul></nav></div></div>
|
|
87
110
|
<div class="container tsd-generator">
|
|
88
111
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
89
112
|
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
</div></section>
|
|
40
40
|
<section class="tsd-index-section">
|
|
41
41
|
<h3 class="tsd-index-heading">Methods</h3>
|
|
42
|
-
<div class="tsd-index-list"><a href="BetterLockOptions.html#
|
|
42
|
+
<div class="tsd-index-list"><a href="BetterLockOptions.html#lock_condition" class="tsd-index-link tsd-kind-method tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12" id="icon-2048-path"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)" id="icon-2048-text"></path></svg><span>lock_<wbr/>condition</span></a>
|
|
43
|
+
<a href="BetterLockOptions.html#promise_tester" class="tsd-index-link tsd-kind-method tsd-parent-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>promise_<wbr/>tester</span></a>
|
|
43
44
|
</div></section></div></details></section></section>
|
|
44
45
|
<section class="tsd-panel-group tsd-member-group">
|
|
45
46
|
<h2>Properties</h2>
|
|
@@ -51,7 +52,7 @@ If you do that, though, and you have a swallowed callback, the lock can remain l
|
|
|
51
52
|
</div><aside class="tsd-sources">
|
|
52
53
|
<p>Overrides <a href="BetterLockJobOptions.html">BetterLockJobOptions</a>.<a href="BetterLockJobOptions.html#execution_timeout">execution_timeout</a></p>
|
|
53
54
|
<ul>
|
|
54
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
55
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L45">options.ts:45</a></li></ul></aside></section>
|
|
55
56
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="extend_stack_traces" class="tsd-anchor"></a>
|
|
56
57
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>extend_<wbr/>stack_<wbr/>traces</span><a href="#extend_stack_traces" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
57
58
|
<div class="tsd-signature">extend_<wbr/>stack_<wbr/>traces<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
@@ -60,35 +61,35 @@ Defaults to true.</p>
|
|
|
60
61
|
</div><aside class="tsd-sources">
|
|
61
62
|
<p>Overrides <a href="BetterLockJobOptions.html">BetterLockJobOptions</a>.<a href="BetterLockJobOptions.html#extend_stack_traces">extend_stack_traces</a></p>
|
|
62
63
|
<ul>
|
|
63
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
64
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L77">options.ts:77</a></li></ul></aside></section>
|
|
64
65
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="log" class="tsd-anchor"></a>
|
|
65
66
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>log</span><a href="#log" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
66
67
|
<div class="tsd-signature">log<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>msg<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div>
|
|
67
68
|
<div class="tsd-comment tsd-typography"><p>Whether to log the internal actions. Set to true to use console.log. Alternatively, provide your own function</p>
|
|
68
69
|
</div><aside class="tsd-sources">
|
|
69
70
|
<ul>
|
|
70
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
71
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L71">options.ts:71</a></li></ul></aside></section>
|
|
71
72
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="name" class="tsd-anchor"></a>
|
|
72
73
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
73
74
|
<div class="tsd-signature">name<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div>
|
|
74
75
|
<div class="tsd-comment tsd-typography"><p>Lock name. This will be written in all logs and error messages, to help you distinguish between different locks</p>
|
|
75
76
|
</div><aside class="tsd-sources">
|
|
76
77
|
<ul>
|
|
77
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
78
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L66">options.ts:66</a></li></ul></aside></section>
|
|
78
79
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="queue_ejection_strategy" class="tsd-anchor"></a>
|
|
79
80
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>queue_<wbr/>ejection_<wbr/>strategy</span><a href="#queue_ejection_strategy" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
80
81
|
<div class="tsd-signature">queue_<wbr/>ejection_<wbr/>strategy<span class="tsd-signature-symbol">?:</span> <a href="../types/BetterLockQueueEjectionStrategy.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockQueueEjectionStrategy</a></div>
|
|
81
82
|
<div class="tsd-comment tsd-typography"><p>If queue is full, which job to eject. Defaults to 'oldest'.</p>
|
|
82
83
|
</div><aside class="tsd-sources">
|
|
83
84
|
<ul>
|
|
84
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
85
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L55">options.ts:55</a></li></ul></aside></section>
|
|
85
86
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="queue_size" class="tsd-anchor"></a>
|
|
86
87
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>queue_<wbr/>size</span><a href="#queue_size" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
87
88
|
<div class="tsd-signature">queue_<wbr/>size<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div>
|
|
88
89
|
<div class="tsd-comment tsd-typography"><p>Max queue size for waiting jobs.</p>
|
|
89
90
|
</div><aside class="tsd-sources">
|
|
90
91
|
<ul>
|
|
91
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
92
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L50">options.ts:50</a></li></ul></aside></section>
|
|
92
93
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="wait_timeout" class="tsd-anchor"></a>
|
|
93
94
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>wait_<wbr/>timeout</span><a href="#wait_timeout" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
94
95
|
<div class="tsd-signature">wait_<wbr/>timeout<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div>
|
|
@@ -96,9 +97,25 @@ Defaults to true.</p>
|
|
|
96
97
|
</div><aside class="tsd-sources">
|
|
97
98
|
<p>Overrides <a href="BetterLockJobOptions.html">BetterLockJobOptions</a>.<a href="BetterLockJobOptions.html#wait_timeout">wait_timeout</a></p>
|
|
98
99
|
<ul>
|
|
99
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
100
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L39">options.ts:39</a></li></ul></aside></section></section>
|
|
100
101
|
<section class="tsd-panel-group tsd-member-group">
|
|
101
102
|
<h2>Methods</h2>
|
|
103
|
+
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="lock_condition" class="tsd-anchor"></a>
|
|
104
|
+
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>lock_<wbr/>condition</span><a href="#lock_condition" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
105
|
+
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
106
|
+
<li class="tsd-signature" id="lock_condition.lock_condition-1">lock_<wbr/>condition<span class="tsd-signature-symbol">(</span>key<span class="tsd-signature-symbol">: </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol"> | </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul>
|
|
107
|
+
<ul class="tsd-descriptions">
|
|
108
|
+
<li class="tsd-description">
|
|
109
|
+
<div class="tsd-comment tsd-typography"><p>Before acquiring lock, call this function with the given key. If condition is rejected, the executor is immediately called, without locking.
|
|
110
|
+
This can be used to more conveniently opt out of locking, without duplicating or extracting the executor.</p>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tsd-parameters">
|
|
113
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
114
|
+
<ul class="tsd-parameter-list">
|
|
115
|
+
<li>
|
|
116
|
+
<h5>key: <a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol"> | </span><a href="../types/BetterLockKey.html" class="tsd-signature-type" data-tsd-kind="Type alias">BetterLockKey</a><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
|
|
117
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
|
|
118
|
+
<p>Overrides <a href="BetterLockJobOptions.html">BetterLockJobOptions</a>.<a href="BetterLockJobOptions.html#lock_condition">lock_condition</a></p></aside></li></ul></section>
|
|
102
119
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="promise_tester" class="tsd-anchor"></a>
|
|
103
120
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>promise_<wbr/>tester</span><a href="#promise_tester" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
104
121
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface">
|
|
@@ -147,6 +164,7 @@ you might want to tighten or loosen this bit.</p>
|
|
|
147
164
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockOptions.html#queue_ejection_strategy" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>queue_<wbr/>ejection_<wbr/>strategy</a></li>
|
|
148
165
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockOptions.html#queue_size" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>queue_<wbr/>size</a></li>
|
|
149
166
|
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="BetterLockOptions.html#wait_timeout" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-1024-path"></use><use href="#icon-1024-text"></use></svg>wait_<wbr/>timeout</a></li>
|
|
167
|
+
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="BetterLockOptions.html#lock_condition" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>lock_<wbr/>condition</a></li>
|
|
150
168
|
<li class="tsd-kind-method tsd-parent-kind-interface"><a href="BetterLockOptions.html#promise_tester" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg>promise_<wbr/>tester</a></li></ul></li></ul></nav></div></div>
|
|
151
169
|
<div class="container tsd-generator">
|
|
152
170
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
<a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockJobAbortedError" class="tsd-index-link tsd-kind-reference tsd-parent-kind-namespace"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg><span>Better<wbr/>Lock<wbr/>Job<wbr/>Aborted<wbr/>Error</span></a>
|
|
29
29
|
<a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockQueueOverflowError" class="tsd-index-link tsd-kind-reference tsd-parent-kind-namespace"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg><span>Better<wbr/>Lock<wbr/>Queue<wbr/>Overflow<wbr/>Error</span></a>
|
|
30
30
|
<a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockWaitTimeoutError" class="tsd-index-link tsd-kind-reference tsd-parent-kind-namespace"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg><span>Better<wbr/>Lock<wbr/>Wait<wbr/>Timeout<wbr/>Error</span></a>
|
|
31
|
+
</div></section>
|
|
32
|
+
<section class="tsd-index-section">
|
|
33
|
+
<h3 class="tsd-index-heading">Functions</h3>
|
|
34
|
+
<div class="tsd-index-list"><a href="../functions/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.isAcquisitionFailureError.html" class="tsd-index-link tsd-kind-function tsd-parent-kind-namespace"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg><span>is<wbr/>Acquisition<wbr/>Failure<wbr/>Error</span></a>
|
|
31
35
|
</div></section></div></details></section></section>
|
|
32
36
|
<section class="tsd-panel-group tsd-member-group">
|
|
33
37
|
<h2>References</h2>
|
|
@@ -74,7 +78,8 @@
|
|
|
74
78
|
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockInvalidArgumentError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Invalid<wbr/>Argument<wbr/>Error</a></li>
|
|
75
79
|
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockJobAbortedError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Job<wbr/>Aborted<wbr/>Error</a></li>
|
|
76
80
|
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockQueueOverflowError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Queue<wbr/>Overflow<wbr/>Error</a></li>
|
|
77
|
-
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockWaitTimeoutError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Wait<wbr/>Timeout<wbr/>Error</a></li
|
|
81
|
+
<li class="tsd-kind-reference tsd-parent-kind-namespace"><a href="_internal_.__home_panta_dev_pantas_better_lock_src_errors_.html#BetterLockWaitTimeoutError" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-8388608-path"></use><use href="#icon-8388608-text"></use></svg>Better<wbr/>Lock<wbr/>Wait<wbr/>Timeout<wbr/>Error</a></li>
|
|
82
|
+
<li class="tsd-kind-function tsd-parent-kind-namespace"><a href="../functions/_internal_.__home_panta_dev_pantas_better_lock_src_errors_.isAcquisitionFailureError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>is<wbr/>Acquisition<wbr/>Failure<wbr/>Error</a></li></ul></nav></div></div>
|
|
78
83
|
<div class="container tsd-generator">
|
|
79
84
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
80
85
|
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<div class="tsd-comment tsd-typography"><p>All error names that we can emit</p>
|
|
18
18
|
</div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/types.ts#L8">types.ts:8</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<li>
|
|
20
20
|
<h4>TResult</h4></li></ul><aside class="tsd-sources">
|
|
21
21
|
<ul>
|
|
22
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
22
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/types.ts#L24">types.ts:24</a></li></ul></aside></div>
|
|
23
23
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
24
24
|
<div class="tsd-navigation settings">
|
|
25
25
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<div class="tsd-comment tsd-typography"><p>Key types that can be used for a lock.</p>
|
|
18
18
|
</div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/types.ts#L29">types.ts:29</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<h1>Type alias BetterLockQueueEjectionStrategy</h1></div>
|
|
16
16
|
<div class="tsd-signature">Better<wbr/>Lock<wbr/>Queue<wbr/>Ejection<wbr/>Strategy<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"oldest"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"newest"</span></div><aside class="tsd-sources">
|
|
17
17
|
<ul>
|
|
18
|
-
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/
|
|
18
|
+
<li>Defined in <a href="https://github.com/panta82/better-lock/blob/91aeb2b/src/options.ts#L30">options.ts:30</a></li></ul></aside></div>
|
|
19
19
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
20
20
|
<div class="tsd-navigation settings">
|
|
21
21
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|