@thi.ng/fibers 1.0.0 → 1.0.1
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/CHANGELOG.md +7 -1
- package/README.md +3 -3
- package/csp.d.ts +2 -1
- package/fiber.d.ts +4 -4
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-20T14:42:45Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [1.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@1.0.1) (2024-04-20)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update type usage ([9df7cb0](https://github.com/thi-ng/umbrella/commit/9df7cb0))
|
|
17
|
+
|
|
12
18
|
# [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@1.0.0) (2024-04-11)
|
|
13
19
|
|
|
14
20
|
#### 🛑 Breaking changes
|
package/README.md
CHANGED
|
@@ -204,7 +204,7 @@ values are being read, essentially a memory management issue).
|
|
|
204
204
|
#### Buffering behaviors
|
|
205
205
|
|
|
206
206
|
The following channel buffer types/behaviors are included (from the
|
|
207
|
-
[thi.ng/buffers](https://thi
|
|
207
|
+
[thi.ng/buffers](https://github.com/thi-ng/umbrella/tree/develop/packages/buffers) package), all accepting a max. capacity
|
|
208
208
|
and all implementing the
|
|
209
209
|
[IReadWriteBuffer](https://docs.thi.ng/umbrella/fibers/interfaces/IReadWriteBuffer.html)
|
|
210
210
|
interface required by the channel:
|
|
@@ -386,10 +386,10 @@ import * as fib from "@thi.ng/fibers";
|
|
|
386
386
|
Browser ESM import:
|
|
387
387
|
|
|
388
388
|
```html
|
|
389
|
-
<script type="module" src="https://
|
|
389
|
+
<script type="module" src="https://esm.run/@thi.ng/fibers"></script>
|
|
390
390
|
```
|
|
391
391
|
|
|
392
|
-
[
|
|
392
|
+
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
393
393
|
|
|
394
394
|
For Node.js REPL:
|
|
395
395
|
|
package/csp.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from "@thi.ng/api";
|
|
1
2
|
import type { IReadWriteBuffer } from "@thi.ng/buffers";
|
|
2
3
|
import { DroppingBuffer } from "@thi.ng/buffers/dropping";
|
|
3
4
|
import { FIFOBuffer } from "@thi.ng/buffers/fifo";
|
|
@@ -35,7 +36,7 @@ export declare class Channel<T> {
|
|
|
35
36
|
* const val = yield* chan.read();
|
|
36
37
|
* ```
|
|
37
38
|
*/
|
|
38
|
-
read(): Fiber<T
|
|
39
|
+
read(): Fiber<Maybe<T>>;
|
|
39
40
|
/**
|
|
40
41
|
* Returns a new fiber which attempts to write the given `value` to the
|
|
41
42
|
* channel and "blocks" until channel is writable (which depends on the
|
package/fiber.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Event as $Event, Fn, Fn0, IDeref, IID, IIDGen, INotify, Listener, Nullable } from "@thi.ng/api";
|
|
1
|
+
import type { Event as $Event, Fn, Fn0, IDeref, IID, IIDGen, INotify, Listener, Maybe, Nullable } from "@thi.ng/api";
|
|
2
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
3
3
|
import { type FiberEventType, type FiberFactory, type FiberOpts, type MaybeFiber, type State } from "./api.js";
|
|
4
4
|
export declare const setDefaultIDGen: (gen: IIDGen<string>) => IIDGen<string>;
|
|
5
|
-
export declare class Fiber<T = any> implements IDeref<T
|
|
5
|
+
export declare class Fiber<T = any> implements IDeref<Maybe<T>>, IID<string>, INotify<FiberEventType> {
|
|
6
6
|
/**
|
|
7
7
|
* This fiber's user provided or generated ID.
|
|
8
8
|
*/
|
|
@@ -20,7 +20,7 @@ export declare class Fiber<T = any> implements IDeref<T | undefined>, IID<string
|
|
|
20
20
|
error?: Error;
|
|
21
21
|
logger?: ILogger;
|
|
22
22
|
user?: Partial<Pick<FiberOpts, "init" | "deinit" | "catch">>;
|
|
23
|
-
_promise?: Promise<T
|
|
23
|
+
_promise?: Promise<Maybe<T>>;
|
|
24
24
|
constructor(gen?: Nullable<FiberFactory<T> | Generator<unknown, T>>, opts?: Partial<FiberOpts>);
|
|
25
25
|
/**
|
|
26
26
|
* Co-routine which blocks whilst this fiber (incl. its children) is active.
|
|
@@ -42,7 +42,7 @@ export declare class Fiber<T = any> implements IDeref<T | undefined>, IID<string
|
|
|
42
42
|
*
|
|
43
43
|
* @param delay
|
|
44
44
|
*/
|
|
45
|
-
promise(delay?: number): Promise<T
|
|
45
|
+
promise(delay?: number): Promise<Maybe<T>>;
|
|
46
46
|
/**
|
|
47
47
|
* Returns this fiber's result value (if any). Only available if the fiber
|
|
48
48
|
* completed successfully and produced a value (either by returning a value
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/fibers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Process hierarchies & operators for cooperative multitasking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.
|
|
40
|
-
"@thi.ng/arrays": "^2.9.
|
|
41
|
-
"@thi.ng/bench": "^3.5.
|
|
42
|
-
"@thi.ng/buffers": "^0.1.
|
|
43
|
-
"@thi.ng/checks": "^3.6.
|
|
44
|
-
"@thi.ng/errors": "^2.5.
|
|
45
|
-
"@thi.ng/idgen": "^2.2.
|
|
46
|
-
"@thi.ng/logger": "^3.0.
|
|
47
|
-
"@thi.ng/random": "^3.7.
|
|
39
|
+
"@thi.ng/api": "^8.11.0",
|
|
40
|
+
"@thi.ng/arrays": "^2.9.4",
|
|
41
|
+
"@thi.ng/bench": "^3.5.4",
|
|
42
|
+
"@thi.ng/buffers": "^0.1.1",
|
|
43
|
+
"@thi.ng/checks": "^3.6.2",
|
|
44
|
+
"@thi.ng/errors": "^2.5.5",
|
|
45
|
+
"@thi.ng/idgen": "^2.2.39",
|
|
46
|
+
"@thi.ng/logger": "^3.0.10",
|
|
47
|
+
"@thi.ng/random": "^3.7.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@microsoft/api-extractor": "^7.43.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"status": "alpha",
|
|
111
111
|
"year": 2023
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "8339d05ecc857e529c7325a9839c0063b89e728d\n"
|
|
114
114
|
}
|