Skip to content

Commit 8491156

Browse files
Rebuild v2.1.0
1 parent c1d56be commit 8491156

38 files changed

+263
-249
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ Introduces synchronous versions of methods.
2626

2727
- lockGuardSync
2828

29+
### Misc
30+
31+
- Update dev dependencies
32+
- Add support for [JSR](https://jsr.io/@rojas/semafy):
33+
```bash
34+
jsr add @rojas/semafy
35+
```
36+
2937
## [2.0.7](https://github.com/havelessbemore/semafy/compare/v2.0.6...v2.0.7) (2024-05-15)
3038

3139
### What's New

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Yarn:
3232
yarn add semafy
3333
```
3434

35+
JSR:
36+
37+
```bash
38+
jsr add @rojas/semafy
39+
```
40+
3541
## API
3642

3743
### Generics

docs/classes/ConditionVariable.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Behavior is undefined if:
2828

2929
#### Source
3030

31-
[src/condVars/conditionVariable.ts:26](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L26)
31+
[src/condVars/conditionVariable.ts:26](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L26)
3232

3333
### new ConditionVariable()
3434

@@ -50,7 +50,7 @@ The byte offset within `sharedBuffer`. Defaults to `0`.
5050

5151
#### Source
5252

53-
[src/condVars/conditionVariable.ts:31](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L31)
53+
[src/condVars/conditionVariable.ts:31](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L31)
5454

5555
## Properties
5656

@@ -62,7 +62,7 @@ The shared atomic memory where the condition variable stores its state.
6262

6363
#### Source
6464

65-
[src/condVars/conditionVariable.ts:24](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L24)
65+
[src/condVars/conditionVariable.ts:24](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L24)
6666

6767
## Accessors
6868

@@ -79,7 +79,7 @@ and primary storage for shared data.
7979

8080
#### Source
8181

82-
[src/condVars/conditionVariable.ts:43](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L43)
82+
[src/condVars/conditionVariable.ts:43](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L43)
8383

8484
***
8585

@@ -95,7 +95,7 @@ The total length in bytes being used from the SharedArrayBuffer.
9595

9696
#### Source
9797

98-
[src/condVars/conditionVariable.ts:47](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L47)
98+
[src/condVars/conditionVariable.ts:47](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L47)
9999

100100
***
101101

@@ -111,7 +111,7 @@ The byte offset within the SharedArrayBuffer where data begins.
111111

112112
#### Source
113113

114-
[src/condVars/conditionVariable.ts:51](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L51)
114+
[src/condVars/conditionVariable.ts:51](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L51)
115115

116116
## Methods
117117

@@ -135,7 +135,7 @@ The number of agents that were notified.
135135

136136
#### Source
137137

138-
[src/condVars/conditionVariable.ts:62](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L62)
138+
[src/condVars/conditionVariable.ts:62](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L62)
139139

140140
***
141141

@@ -153,7 +153,7 @@ The number of agents that were notified.
153153

154154
#### Source
155155

156-
[src/condVars/conditionVariable.ts:71](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L71)
156+
[src/condVars/conditionVariable.ts:71](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L71)
157157

158158
***
159159

@@ -171,7 +171,7 @@ The number of agents that were notified.
171171

172172
#### Source
173173

174-
[src/condVars/conditionVariable.ts:80](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L80)
174+
[src/condVars/conditionVariable.ts:80](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L80)
175175

176176
***
177177

@@ -203,7 +203,7 @@ A RangeError If the shared memory data is unexpected.
203203

204204
#### Source
205205

206-
[src/condVars/conditionVariable.ts:94](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L94)
206+
[src/condVars/conditionVariable.ts:94](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L94)
207207

208208
***
209209

@@ -241,7 +241,7 @@ A RangeError If the shared memory data is unexpected.
241241

242242
#### Source
243243

244-
[src/condVars/conditionVariable.ts:111](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L111)
244+
[src/condVars/conditionVariable.ts:111](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L111)
245245

246246
***
247247

@@ -279,4 +279,4 @@ A RangeError If the shared memory data is unexpected.
279279

280280
#### Source
281281

282-
[src/condVars/conditionVariable.ts:148](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L148)
282+
[src/condVars/conditionVariable.ts:148](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L148)

docs/classes/CountingSemaphore.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A RangeError if `desired` is negative or exceeds [CountingSemaphore.Max](Countin
3636

3737
#### Source
3838

39-
[src/semaphores/countingSemaphore.ts:39](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L39)
39+
[src/semaphores/countingSemaphore.ts:39](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L39)
4040

4141
### new CountingSemaphore()
4242

@@ -58,7 +58,7 @@ The byte offset within the shared buffer. Defaults to `0`.
5858

5959
#### Source
6060

61-
[src/semaphores/countingSemaphore.ts:44](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L44)
61+
[src/semaphores/countingSemaphore.ts:44](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L44)
6262

6363
## Properties
6464

@@ -68,7 +68,7 @@ The byte offset within the shared buffer. Defaults to `0`.
6868
6969
#### Source
7070

71-
[src/semaphores/countingSemaphore.ts:29](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L29)
71+
[src/semaphores/countingSemaphore.ts:29](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L29)
7272

7373
***
7474

@@ -78,7 +78,7 @@ The byte offset within the shared buffer. Defaults to `0`.
7878
7979
#### Source
8080

81-
[src/semaphores/countingSemaphore.ts:30](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L30)
81+
[src/semaphores/countingSemaphore.ts:30](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L30)
8282

8383
***
8484

@@ -88,7 +88,7 @@ The byte offset within the shared buffer. Defaults to `0`.
8888
8989
#### Source
9090

91-
[src/semaphores/countingSemaphore.ts:31](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L31)
91+
[src/semaphores/countingSemaphore.ts:31](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L31)
9292

9393
***
9494

@@ -100,7 +100,7 @@ The maximum possible value of the internal counter
100100

101101
#### Source
102102

103-
[src/semaphores/countingSemaphore.ts:27](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L27)
103+
[src/semaphores/countingSemaphore.ts:27](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L27)
104104

105105
## Accessors
106106

@@ -117,7 +117,7 @@ and primary storage for shared data.
117117

118118
#### Source
119119

120-
[src/semaphores/countingSemaphore.ts:81](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L81)
120+
[src/semaphores/countingSemaphore.ts:81](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L81)
121121

122122
***
123123

@@ -133,7 +133,7 @@ The total length in bytes being used from the SharedArrayBuffer.
133133

134134
#### Source
135135

136-
[src/semaphores/countingSemaphore.ts:85](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L85)
136+
[src/semaphores/countingSemaphore.ts:85](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L85)
137137

138138
***
139139

@@ -149,7 +149,7 @@ The byte offset within the SharedArrayBuffer where data begins.
149149

150150
#### Source
151151

152-
[src/semaphores/countingSemaphore.ts:89](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L89)
152+
[src/semaphores/countingSemaphore.ts:89](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L89)
153153

154154
## Methods
155155

@@ -167,7 +167,7 @@ A promise that resolves when acquisition is successful.
167167

168168
#### Source
169169

170-
[src/semaphores/countingSemaphore.ts:98](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L98)
170+
[src/semaphores/countingSemaphore.ts:98](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L98)
171171

172172
***
173173

@@ -193,7 +193,7 @@ If `count` is negative or would cause the semaphore to overflow.
193193

194194
#### Source
195195

196-
[src/semaphores/countingSemaphore.ts:184](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L184)
196+
[src/semaphores/countingSemaphore.ts:184](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L184)
197197

198198
***
199199

@@ -211,7 +211,7 @@ A promise resolving to `true` if successful, otherwise `false`.
211211

212212
#### Source
213213

214-
[src/semaphores/countingSemaphore.ts:115](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L115)
214+
[src/semaphores/countingSemaphore.ts:115](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L115)
215215

216216
***
217217

@@ -236,7 +236,7 @@ A promise resolving to `true` if successful, otherwise `false`.
236236

237237
#### Source
238238

239-
[src/semaphores/countingSemaphore.ts:137](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L137)
239+
[src/semaphores/countingSemaphore.ts:137](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L137)
240240

241241
***
242242

@@ -261,4 +261,4 @@ A promise resolved to `true` if succesful, otherwise `false`.
261261

262262
#### Source
263263

264-
[src/semaphores/countingSemaphore.ts:149](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L149)
264+
[src/semaphores/countingSemaphore.ts:149](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L149)

docs/classes/Latch.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ A RangeError if `expected` is negative or exceeds [Latch.Max](Latch.md#max).
3232

3333
#### Source
3434

35-
[src/barriers/latch.ts:48](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L48)
35+
[src/barriers/latch.ts:48](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L48)
3636

3737
### new Latch()
3838

@@ -54,7 +54,7 @@ The byte offset within the shared buffer. Defaults to `0`.
5454

5555
#### Source
5656

57-
[src/barriers/latch.ts:53](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L53)
57+
[src/barriers/latch.ts:53](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L53)
5858

5959
## Properties
6060

@@ -66,7 +66,7 @@ Condition variable to manage waiting agents.
6666

6767
#### Source
6868

69-
[src/barriers/latch.ts:30](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L30)
69+
[src/barriers/latch.ts:30](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L30)
7070

7171
***
7272

@@ -78,7 +78,7 @@ The shared atomic memory for the internal counter.
7878

7979
#### Source
8080

81-
[src/barriers/latch.ts:35](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L35)
81+
[src/barriers/latch.ts:35](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L35)
8282

8383
***
8484

@@ -90,7 +90,7 @@ Mutex to protect access to the internal counter.
9090

9191
#### Source
9292

93-
[src/barriers/latch.ts:40](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L40)
93+
[src/barriers/latch.ts:40](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L40)
9494

9595
***
9696

@@ -102,7 +102,7 @@ The maximum possible value of the internal counter.
102102

103103
#### Source
104104

105-
[src/barriers/latch.ts:25](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L25)
105+
[src/barriers/latch.ts:25](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L25)
106106

107107
## Methods
108108

@@ -133,7 +133,7 @@ A RangeError If `n` is negative or exceeds the current count.
133133

134134
#### Source
135135

136-
[src/barriers/latch.ts:139](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L139)
136+
[src/barriers/latch.ts:139](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L139)
137137

138138
***
139139

@@ -161,7 +161,7 @@ A RangeError If `n` is negative or exceeds the current count.
161161

162162
#### Source
163163

164-
[src/barriers/latch.ts:99](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L99)
164+
[src/barriers/latch.ts:99](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L99)
165165

166166
***
167167

@@ -179,7 +179,7 @@ Tests if the counter has reached zero.
179179

180180
#### Source
181181

182-
[src/barriers/latch.ts:178](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L178)
182+
[src/barriers/latch.ts:178](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L178)
183183

184184
***
185185

@@ -198,4 +198,4 @@ allowing the agent to proceed.
198198

199199
#### Source
200200

201-
[src/barriers/latch.ts:188](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L188)
201+
[src/barriers/latch.ts:188](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L188)

docs/classes/LockError.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ An optional custom error message.
4141

4242
#### Source
4343

44-
[src/errors/lockError.ts:10](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/errors/lockError.ts#L10)
44+
[src/errors/lockError.ts:10](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/errors/lockError.ts#L10)
4545

4646
## Properties
4747

0 commit comments

Comments
 (0)