@thi.ng/fibers 0.6.25 → 0.6.27
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 +1 -1
- package/README.md +7 -0
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -246,6 +246,9 @@ or write to a channel.
|
|
|
246
246
|
Channels can be created like so:
|
|
247
247
|
|
|
248
248
|
```ts
|
|
249
|
+
import { channel, sliding } from "@thi.ng/fibers";
|
|
250
|
+
import { ConsoleLogger } from "@thi.ng/logger";
|
|
251
|
+
|
|
249
252
|
// create unbuffered channel with single value capacity
|
|
250
253
|
const chan1 = channel();
|
|
251
254
|
|
|
@@ -348,6 +351,10 @@ fibers, the various channel operations can be already combined with the
|
|
|
348
351
|
For example, a channel read or write op can be combined with a timeout:
|
|
349
352
|
|
|
350
353
|
```ts
|
|
354
|
+
import { withTimeout } from "@thi.ng/fibers";
|
|
355
|
+
|
|
356
|
+
// ...then, inside a fiber function...
|
|
357
|
+
|
|
351
358
|
const res = (yield* withTimeout(chan.read(), 1000)).deref();
|
|
352
359
|
if (res !== undefined) {
|
|
353
360
|
console.log("read value", x);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/fibers",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.27",
|
|
4
4
|
"description": "Process hierarchies & operators for cooperative multitasking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,17 +32,18 @@
|
|
|
32
32
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
34
34
|
"pub": "yarn npm publish --access public",
|
|
35
|
-
"test": "bun test"
|
|
35
|
+
"test": "bun test",
|
|
36
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/arrays": "^2.8.
|
|
40
|
-
"@thi.ng/bench": "^3.4.
|
|
41
|
-
"@thi.ng/checks": "^3.5.
|
|
42
|
-
"@thi.ng/errors": "^2.4.
|
|
43
|
-
"@thi.ng/idgen": "^2.2.
|
|
44
|
-
"@thi.ng/logger": "^3.0.
|
|
45
|
-
"@thi.ng/random": "^3.6.
|
|
39
|
+
"@thi.ng/api": "^8.9.28",
|
|
40
|
+
"@thi.ng/arrays": "^2.8.6",
|
|
41
|
+
"@thi.ng/bench": "^3.4.32",
|
|
42
|
+
"@thi.ng/checks": "^3.5.2",
|
|
43
|
+
"@thi.ng/errors": "^2.4.20",
|
|
44
|
+
"@thi.ng/idgen": "^2.2.32",
|
|
45
|
+
"@thi.ng/logger": "^3.0.5",
|
|
46
|
+
"@thi.ng/random": "^3.6.35"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -108,5 +109,5 @@
|
|
|
108
109
|
"status": "alpha",
|
|
109
110
|
"year": 2023
|
|
110
111
|
},
|
|
111
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
112
113
|
}
|