repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
2e4ab51
parent
f5dd5aa
author
Eric Bower
date
2023-12-16 02:45:35 +0000 UTC
chore: rename files and remove old fx
8 files changed,  +5, -17
M mod.ts
M deps.ts
+1, -0
1@@ -23,6 +23,7 @@ export {
2   createScope,
3   createSignal,
4   each,
5+  ensure,
6   Err,
7   Ok,
8   resource,
D fx/defer.ts
+0, -12
 1@@ -1,12 +0,0 @@
 2-import { resource } from "../deps.ts";
 3-import type { Operation } from "../deps.ts";
 4-
 5-export function defer(op: () => Operation<unknown>): Operation<void> {
 6-  return resource(function* (provide) {
 7-    try {
 8-      yield* provide();
 9-    } finally {
10-      yield* op();
11-    }
12-  });
13-}
M fx/mod.ts
+1, -2
1@@ -1,6 +1,5 @@
2 export * from "./parallel.ts";
3-export * from "./call.ts";
4+export * from "./safe.ts";
5 export * from "./race.ts";
6 export * from "./request.ts";
7 export * from "./supervisor.ts";
8-export * from "./defer.ts";
M fx/parallel.ts
+1, -2
 1@@ -1,8 +1,7 @@
 2 import type { Callable, Channel, Operation, Result } from "../deps.ts";
 3 import type { Computation } from "../types.ts";
 4 import { createChannel, resource, spawn } from "../deps.ts";
 5-
 6-import { safe } from "./call.ts";
 7+import { safe } from "./safe.ts";
 8 
 9 export interface ParallelRet<T> extends Computation<Result<T>[]> {
10   sequence: Channel<Result<T>, void>;
R fx/call.test.ts => fx/safe.test.ts
+0, -0
R fx/call.ts => fx/safe.ts
+0, -0
M fx/supervisor.ts
+1, -1
1@@ -1,5 +1,5 @@
2 import { Callable, Operation, Result, sleep } from "../deps.ts";
3-import { safe } from "./call.ts";
4+import { safe } from "./safe.ts";
5 import { parallel } from "./parallel.ts";
6 import { log } from "../log.ts";
7 
M mod.ts
+1, -0
1@@ -13,6 +13,7 @@ export {
2   createScope,
3   createSignal,
4   each,
5+  ensure,
6   Err,
7   Ok,
8   resource,