Skip to content

Commit

Permalink
Rebuild v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
havelessbemore committed Jun 13, 2024
1 parent c1d56be commit 8491156
Show file tree
Hide file tree
Showing 38 changed files with 263 additions and 249 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ Introduces synchronous versions of methods.

- lockGuardSync

### Misc

- Update dev dependencies
- Add support for [JSR](https://jsr.io/@rojas/semafy):
```bash
jsr add @rojas/semafy
```

## [2.0.7](https://github.com/havelessbemore/semafy/compare/v2.0.6...v2.0.7) (2024-05-15)

### What's New
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Yarn:
yarn add semafy
```

JSR:

```bash
jsr add @rojas/semafy
```

## API

### Generics
Expand Down
24 changes: 12 additions & 12 deletions docs/classes/ConditionVariable.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Behavior is undefined if:

#### Source

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

### new ConditionVariable()

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

#### Source

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

## Properties

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

#### Source

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

## Accessors

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

## Methods

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

[src/condVars/conditionVariable.ts:148](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/condVars/conditionVariable.ts#L148)
[src/condVars/conditionVariable.ts:148](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/condVars/conditionVariable.ts#L148)
28 changes: 14 additions & 14 deletions docs/classes/CountingSemaphore.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A RangeError if `desired` is negative or exceeds [CountingSemaphore.Max](Countin

#### Source

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

### new CountingSemaphore()

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

#### Source

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

## Properties

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

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

***

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

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

***

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

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

***

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

#### Source

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

## Accessors

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

## Methods

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

[src/semaphores/countingSemaphore.ts:149](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/semaphores/countingSemaphore.ts#L149)
[src/semaphores/countingSemaphore.ts:149](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/semaphores/countingSemaphore.ts#L149)
20 changes: 10 additions & 10 deletions docs/classes/Latch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A RangeError if `expected` is negative or exceeds [Latch.Max](Latch.md#max).

#### Source

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

### new Latch()

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

#### Source

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

## Properties

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

## Methods

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

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

***

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

#### Source

[src/barriers/latch.ts:188](https://github.com/havelessbemore/semafy/blob/149e7eb3316334bacba0da85965a5d191883e2fc/src/barriers/latch.ts#L188)
[src/barriers/latch.ts:188](https://github.com/havelessbemore/semafy/blob/c1d56be99a331ecbe5fe1625f5e190ff01b04eee/src/barriers/latch.ts#L188)
2 changes: 1 addition & 1 deletion docs/classes/LockError.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ An optional custom error message.

#### Source

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

## Properties

Expand Down
Loading

0 comments on commit 8491156

Please sign in to comment.