@atolljs/core 0.1.2 → 0.1.3
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/LICENSE +21 -0
- package/README.md +4 -5
- package/dist/contract/listSchema.d.ts +4 -4
- package/dist/contract/reef.d.ts +377 -0
- package/dist/contract/sharedMemory.d.ts +13 -13
- package/dist/contract/zod.d.ts +263 -34
- package/dist/index.d.ts +1 -2
- package/dist/index.js +14 -15
- package/dist/index10.js +185 -14
- package/dist/index11.js +47 -188
- package/dist/index12.js +59 -45
- package/dist/index13.js +19 -58
- package/dist/index14.js +60 -24
- package/dist/index15.js +43 -56
- package/dist/index16.js +41 -45
- package/dist/index17.js +38 -42
- package/dist/index18.js +54 -35
- package/dist/index19.js +46 -51
- package/dist/index20.js +50 -47
- package/dist/index3.js +199 -22
- package/dist/index4.js +66 -61
- package/dist/index6.js +84 -84
- package/dist/index7.js +19 -19
- package/dist/index8.js +33 -6
- package/dist/index9.js +14 -29
- package/package.json +7 -6
- package/src/contract/listSchema.ts +51 -29
- package/src/contract/reef.ts +62 -0
- package/src/contract/sharedMemory.ts +25 -25
- package/src/contract/zod.ts +344 -32
- package/src/index.ts +1 -2
- package/dist/contract/msgpackCodec.d.ts +0 -7
- package/dist/contract/mz.d.ts +0 -43
- package/dist/index21.js +0 -59
- package/src/contract/msgpackCodec.ts +0 -9
- package/src/contract/mz.ts +0 -48
package/dist/index16.js
CHANGED
|
@@ -1,50 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function a(e, t) {
|
|
12
|
-
let n = {};
|
|
13
|
-
for (let [r, i] of Object.entries(t)) {
|
|
14
|
-
let t = "def" in i ? i.def : i;
|
|
15
|
-
n[r] = {
|
|
16
|
-
taskId: t.taskId ?? `${e}.${r}`,
|
|
17
|
-
...t.dataType ? { dataType: t.dataType } : {},
|
|
18
|
-
...t.argsSchema ? { argsSchema: t.argsSchema } : {},
|
|
19
|
-
...t.resultSchema ? { resultSchema: t.resultSchema } : {}
|
|
20
|
-
};
|
|
1
|
+
import { fmtBytes as e, scoped as t } from "./index5.js";
|
|
2
|
+
import { bindSharedMemories as n, getDefinedSharedMemoryCount as r } from "./index6.js";
|
|
3
|
+
import { TaskRegistry as i } from "./index13.js";
|
|
4
|
+
//#region src/worker/workerBootstrap.ts
|
|
5
|
+
var a = t("worker"), o = !1;
|
|
6
|
+
typeof self > "u" ? a.warn("workerBootstrap: no worker global found — skipping message wiring") : self.onmessage = async (t) => {
|
|
7
|
+
let s = t.data;
|
|
8
|
+
if (s.type === "INIT") {
|
|
9
|
+
o = !0, r() > 0 && a.warn("pool sent INIT without memory, but shared-memory contracts are defined — field access will throw until bound"), a.info("initialized (message-only pool — no shared memory)");
|
|
10
|
+
return;
|
|
21
11
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
function o(e, r) {
|
|
28
|
-
let i = Object.keys(e.tasks).filter((e) => {
|
|
29
|
-
let t = r[e];
|
|
30
|
-
return typeof t != "function" && typeof t?.run != "function";
|
|
31
|
-
});
|
|
32
|
-
if (i.length > 0) throw Error(`implementService("${e.name}"): missing handlers for ${i.join(", ")}`);
|
|
33
|
-
for (let [n, i] of Object.entries(e.tasks)) {
|
|
34
|
-
let e = r[n];
|
|
35
|
-
t.register(i, typeof e == "function" ? e.bind(r) : e.run.bind(e));
|
|
12
|
+
if (s.type === "INIT_MEMORY") {
|
|
13
|
+
let t = s.memory;
|
|
14
|
+
n(t.buffer), o = !0, a.info(`shared memory initialized (${e(t.buffer.byteLength)})`);
|
|
15
|
+
return;
|
|
36
16
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
17
|
+
if (s.type === "EXECUTE_TASK") {
|
|
18
|
+
let { messageId: e, taskId: t, args: n } = s;
|
|
19
|
+
if (!o) {
|
|
20
|
+
a.warn(`rejected ${t} — shared memory not initialized`), self.postMessage({
|
|
21
|
+
messageId: e,
|
|
22
|
+
success: !1,
|
|
23
|
+
error: "Shared memory not initialized in worker."
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let r = performance.now();
|
|
28
|
+
try {
|
|
29
|
+
let o = await i.execute(t, ...n || []);
|
|
30
|
+
a.debug(`task ${t} → ${(performance.now() - r).toFixed(1)}ms`), self.postMessage({
|
|
31
|
+
messageId: e,
|
|
32
|
+
success: !0,
|
|
33
|
+
result: o
|
|
34
|
+
});
|
|
35
|
+
} catch (n) {
|
|
36
|
+
a.warn(`task ${t} failed: ${n.message || String(n)}`), self.postMessage({
|
|
37
|
+
messageId: e,
|
|
38
|
+
success: !1,
|
|
39
|
+
error: n.message || String(n)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
47
44
|
//#endregion
|
|
48
|
-
export { s as createClient, a as defineService, o as implementService, r as rpc, i as serviceMethod };
|
|
49
45
|
|
|
50
46
|
//# sourceMappingURL=index16.js.map
|
package/dist/index17.js
CHANGED
|
@@ -1,46 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
//#region src/worker/
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { scoped as e } from "./index5.js";
|
|
2
|
+
import { TaskRegistry as t } from "./index13.js";
|
|
3
|
+
import "./index16.js";
|
|
4
|
+
//#region src/worker/defineWorker.ts
|
|
5
|
+
var n = e("worker"), r = [
|
|
6
|
+
"start",
|
|
7
|
+
"terminate",
|
|
8
|
+
"pool",
|
|
9
|
+
"sharedMemory",
|
|
10
|
+
"then",
|
|
11
|
+
"with"
|
|
12
|
+
], i = (e) => typeof e == "object" && !!e && "run" in e, a = new Set(r);
|
|
13
|
+
function o(e) {
|
|
14
|
+
let r = e.methods ?? {}, o = e.services ?? {}, s = 0, c = (e, n, r, o) => {
|
|
15
|
+
if (a.has(n)) throw Error(`defineWorker: "${n}" is reserved for the client API — rename the method`);
|
|
16
|
+
if (i(r)) {
|
|
17
|
+
let { def: n } = r;
|
|
18
|
+
t.register({
|
|
19
|
+
taskId: n.taskId ?? e,
|
|
20
|
+
...n.dataType ? { dataType: n.dataType } : {},
|
|
21
|
+
...n.argsSchema ? { argsSchema: n.argsSchema } : {},
|
|
22
|
+
...n.resultSchema ? { resultSchema: n.resultSchema } : {}
|
|
23
|
+
}, r.run.bind(r));
|
|
24
|
+
} else t.register({ taskId: e }, r.bind(o));
|
|
25
|
+
s++;
|
|
26
|
+
};
|
|
27
|
+
for (let [e, t] of Object.entries(r)) c(e, e, t, r);
|
|
28
|
+
for (let [e, t] of Object.entries(o)) {
|
|
29
|
+
if (a.has(e)) throw Error(`defineWorker: service name "${e}" is reserved for the client API — rename it`);
|
|
30
|
+
for (let [n, r] of Object.entries(t)) c(`${e}.${n}`, n, r, t);
|
|
11
31
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!o) {
|
|
20
|
-
a.warn(`rejected ${t} — shared memory not initialized`), self.postMessage({
|
|
21
|
-
messageId: e,
|
|
22
|
-
success: !1,
|
|
23
|
-
error: "Shared memory not initialized in worker."
|
|
24
|
-
});
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
let r = performance.now();
|
|
28
|
-
try {
|
|
29
|
-
let o = await i.execute(t, ...n || []);
|
|
30
|
-
a.debug(`task ${t} → ${(performance.now() - r).toFixed(1)}ms`), self.postMessage({
|
|
31
|
-
messageId: e,
|
|
32
|
-
success: !0,
|
|
33
|
-
result: o
|
|
34
|
-
});
|
|
35
|
-
} catch (n) {
|
|
36
|
-
a.warn(`task ${t} failed: ${n.message || String(n)}`), self.postMessage({
|
|
37
|
-
messageId: e,
|
|
38
|
-
success: !1,
|
|
39
|
-
error: n.message || String(n)
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
32
|
+
n.info(`worker defined — ${s} method(s)`);
|
|
33
|
+
let l = {
|
|
34
|
+
methods: r,
|
|
35
|
+
services: o
|
|
36
|
+
};
|
|
37
|
+
return e.sharedMemory && (l.sharedMemory = e.sharedMemory), l;
|
|
38
|
+
}
|
|
44
39
|
//#endregion
|
|
40
|
+
export { r as RESERVED_CLIENT_KEYS, o as defineWorker };
|
|
45
41
|
|
|
46
42
|
//# sourceMappingURL=index17.js.map
|
package/dist/index18.js
CHANGED
|
@@ -1,42 +1,61 @@
|
|
|
1
1
|
import { scoped as e } from "./index5.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
import { createEffect as t, createMemo as n, createRoot as r, createSignal as i } from "solid-js";
|
|
3
|
+
//#region src/reactive.ts
|
|
4
|
+
var a = e("reactive");
|
|
5
|
+
function o(e, t) {
|
|
6
|
+
if (e === t) return !0;
|
|
7
|
+
if (e == null || t == null) return !1;
|
|
8
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
9
|
+
return n.length === r.length && n.every((n) => Object.is(e[n], t[n]));
|
|
10
|
+
}
|
|
11
|
+
function s(e) {
|
|
12
|
+
let [t, n] = i(e.read(), { equals: !1 }), r = () => n(() => e.read());
|
|
13
|
+
return {
|
|
14
|
+
get: t,
|
|
15
|
+
peek: () => e.read(),
|
|
16
|
+
set: (t) => {
|
|
17
|
+
e.write(t), r();
|
|
18
|
+
},
|
|
19
|
+
observeRemote: () => {
|
|
20
|
+
let t = e._version;
|
|
21
|
+
if (!t) throw Error("This connector does not support remote observation.");
|
|
22
|
+
let n = !1, i = Atomics.load(t.view, t.index);
|
|
23
|
+
if (typeof Atomics.waitAsync == "function") return a.debug(`observing remote writes (offset ${e.byteOffset}, waitAsync)`), (async () => {
|
|
24
|
+
for (; !n;) {
|
|
25
|
+
let o = Atomics.waitAsync(t.view, t.index, i);
|
|
26
|
+
o.async && await o.value, i = Atomics.load(t.view, t.index), n || (a.trace(`remote write observed (offset ${e.byteOffset})`), r());
|
|
27
|
+
}
|
|
28
|
+
a.debug(`stopped observing (offset ${e.byteOffset})`);
|
|
29
|
+
})(), () => {
|
|
30
|
+
n = !0;
|
|
31
|
+
};
|
|
32
|
+
a.warn(`Atomics.waitAsync unavailable — observing via 50ms poll (offset ${e.byteOffset})`);
|
|
33
|
+
let o = setInterval(() => {
|
|
34
|
+
let e = Atomics.load(t.view, t.index);
|
|
35
|
+
e !== i && (i = e, r());
|
|
36
|
+
}, 50);
|
|
37
|
+
return () => {
|
|
38
|
+
n = !0, clearInterval(o);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
26
41
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
}
|
|
43
|
+
function c(e, i, o, c) {
|
|
44
|
+
let l = o ? i : ((e) => e), u = o ?? i, d = s(e), f = d.observeRemote(), p = r((e) => {
|
|
45
|
+
let r = n(() => {
|
|
46
|
+
let e = d.get();
|
|
47
|
+
return e == null ? void 0 : l(e);
|
|
48
|
+
}, void 0, c?.equals ? { equals: (e, t) => e === void 0 || t === void 0 ? e === t : c.equals(e, t) } : void 0);
|
|
49
|
+
return t((e) => {
|
|
50
|
+
let t = r();
|
|
51
|
+
return t !== void 0 && u(t, e), t;
|
|
52
|
+
}), e;
|
|
53
|
+
});
|
|
54
|
+
return a.debug(`watching connector at offset ${e.byteOffset}`), () => {
|
|
55
|
+
a.debug(`watch stopped (offset ${e.byteOffset})`), f(), p();
|
|
36
56
|
};
|
|
37
|
-
return e.sharedMemory && (l.sharedMemory = e.sharedMemory), l;
|
|
38
57
|
}
|
|
39
58
|
//#endregion
|
|
40
|
-
export {
|
|
59
|
+
export { s as reactive, o as shallowEqual, c as watch };
|
|
41
60
|
|
|
42
61
|
//# sourceMappingURL=index18.js.map
|
package/dist/index19.js
CHANGED
|
@@ -1,61 +1,56 @@
|
|
|
1
1
|
import { scoped as e } from "./index5.js";
|
|
2
|
-
import {
|
|
3
|
-
//#region src/
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { watch as t } from "./index18.js";
|
|
3
|
+
//#region src/observable.ts
|
|
4
|
+
var n = e("observe");
|
|
5
|
+
function r(e, r, i, a) {
|
|
6
|
+
let o = i ?? ((e) => e), s = a?.equals ?? Object.is, c, l = -1, u = null, d = null, f = null, p = null, m = /* @__PURE__ */ new Set(), h = () => {
|
|
7
|
+
if (u || d) return;
|
|
8
|
+
let i;
|
|
9
|
+
try {
|
|
10
|
+
i = e.connector(String(r));
|
|
11
|
+
} catch {
|
|
12
|
+
d = e.onBound(() => {
|
|
13
|
+
d = null, h();
|
|
14
|
+
});
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
u = t(i, o, (e) => {
|
|
18
|
+
if (c === void 0 || !s(c, e)) {
|
|
19
|
+
c = e;
|
|
20
|
+
for (let t of m) t(e);
|
|
21
|
+
}
|
|
22
|
+
}, a), p = i, f ??= e.onBound(() => {
|
|
23
|
+
let t;
|
|
24
|
+
try {
|
|
25
|
+
t = e.connector(String(r));
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
t !== p && (u?.(), u = null, p = null, h());
|
|
30
|
+
}), n.debug(`observing "${String(r)}" (offset ${i.byteOffset})`);
|
|
31
|
+
}, g = () => {
|
|
32
|
+
u?.(), u = null, p = null, d?.(), d = null, f?.(), f = null;
|
|
33
|
+
};
|
|
13
34
|
return {
|
|
14
|
-
get
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!t) throw Error("This connector does not support remote observation.");
|
|
22
|
-
let n = !1, i = Atomics.load(t.view, t.index);
|
|
23
|
-
if (typeof Atomics.waitAsync == "function") return a.debug(`observing remote writes (offset ${e.byteOffset}, waitAsync)`), (async () => {
|
|
24
|
-
for (; !n;) {
|
|
25
|
-
let o = Atomics.waitAsync(t.view, t.index, i);
|
|
26
|
-
o.async && await o.value, i = Atomics.load(t.view, t.index), n || (a.trace(`remote write observed (offset ${e.byteOffset})`), r());
|
|
35
|
+
get() {
|
|
36
|
+
if (u || e.bound) try {
|
|
37
|
+
let t = e.connector(String(r)), n = t._version ? Atomics.load(t._version.view, t._version.index) : 0;
|
|
38
|
+
if (n !== l) {
|
|
39
|
+
l = n;
|
|
40
|
+
let e = o(t.read());
|
|
41
|
+
(c === void 0 || !s(c, e)) && (c = e);
|
|
27
42
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
let e = Atomics.load(t.view, t.index);
|
|
35
|
-
e !== i && (i = e, r());
|
|
36
|
-
}, 50);
|
|
37
|
-
return () => {
|
|
38
|
-
n = !0, clearInterval(o);
|
|
43
|
+
} catch {}
|
|
44
|
+
return c;
|
|
45
|
+
},
|
|
46
|
+
subscribe(e) {
|
|
47
|
+
return m.add(e), h(), () => {
|
|
48
|
+
m.delete(e), m.size === 0 && g();
|
|
39
49
|
};
|
|
40
50
|
}
|
|
41
51
|
};
|
|
42
52
|
}
|
|
43
|
-
function c(e, i, o, c) {
|
|
44
|
-
let l = o ? i : ((e) => e), u = o ?? i, d = s(e), f = d.observeRemote(), p = r((e) => {
|
|
45
|
-
let r = n(() => {
|
|
46
|
-
let e = d.get();
|
|
47
|
-
return e == null ? void 0 : l(e);
|
|
48
|
-
}, void 0, c?.equals ? { equals: (e, t) => e === void 0 || t === void 0 ? e === t : c.equals(e, t) } : void 0);
|
|
49
|
-
return t((e) => {
|
|
50
|
-
let t = r();
|
|
51
|
-
return t !== void 0 && u(t, e), t;
|
|
52
|
-
}), e;
|
|
53
|
-
});
|
|
54
|
-
return a.debug(`watching connector at offset ${e.byteOffset}`), () => {
|
|
55
|
-
a.debug(`watch stopped (offset ${e.byteOffset})`), f(), p();
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
53
|
//#endregion
|
|
59
|
-
export {
|
|
54
|
+
export { r as observe };
|
|
60
55
|
|
|
61
56
|
//# sourceMappingURL=index19.js.map
|
package/dist/index20.js
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
1
|
import { scoped as e } from "./index5.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
u = t(i, o, (e) => {
|
|
18
|
-
if (c === void 0 || !s(c, e)) {
|
|
19
|
-
c = e;
|
|
20
|
-
for (let t of m) t(e);
|
|
21
|
-
}
|
|
22
|
-
}, a), p = i, f ??= e.onBound(() => {
|
|
23
|
-
let t;
|
|
24
|
-
try {
|
|
25
|
-
t = e.connector(String(r));
|
|
26
|
-
} catch {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
t !== p && (u?.(), u = null, p = null, h());
|
|
30
|
-
}), n.debug(`observing "${String(r)}" (offset ${i.byteOffset})`);
|
|
31
|
-
}, g = () => {
|
|
32
|
-
u?.(), u = null, p = null, d?.(), d = null, f?.(), f = null;
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
get() {
|
|
36
|
-
if (u || e.bound) try {
|
|
37
|
-
let t = e.connector(String(r)), n = t._version ? Atomics.load(t._version.view, t._version.index) : 0;
|
|
38
|
-
if (n !== l) {
|
|
39
|
-
l = n;
|
|
40
|
-
let e = o(t.read());
|
|
41
|
-
(c === void 0 || !s(c, e)) && (c = e);
|
|
42
|
-
}
|
|
43
|
-
} catch {}
|
|
44
|
-
return c;
|
|
45
|
-
},
|
|
2
|
+
//#region src/task.ts
|
|
3
|
+
var t = e("task");
|
|
4
|
+
function n(e) {
|
|
5
|
+
let n = 0, r = {
|
|
6
|
+
data: null,
|
|
7
|
+
pending: !1,
|
|
8
|
+
settled: !1,
|
|
9
|
+
elapsedMs: null,
|
|
10
|
+
error: null
|
|
11
|
+
}, i = /* @__PURE__ */ new Set(), a = (e) => {
|
|
12
|
+
r = e;
|
|
13
|
+
for (let t of i) t(e);
|
|
14
|
+
}, o = {
|
|
15
|
+
get: () => r,
|
|
46
16
|
subscribe(e) {
|
|
47
|
-
return
|
|
48
|
-
|
|
17
|
+
return i.add(e), () => {
|
|
18
|
+
i.delete(e);
|
|
49
19
|
};
|
|
20
|
+
},
|
|
21
|
+
run(i) {
|
|
22
|
+
let o = ++n, s = performance.now();
|
|
23
|
+
a({
|
|
24
|
+
...r,
|
|
25
|
+
pending: !0,
|
|
26
|
+
error: null
|
|
27
|
+
}), e(i).then((e) => {
|
|
28
|
+
o === n && a({
|
|
29
|
+
data: e,
|
|
30
|
+
pending: !1,
|
|
31
|
+
settled: !0,
|
|
32
|
+
elapsedMs: performance.now() - s,
|
|
33
|
+
error: null
|
|
34
|
+
});
|
|
35
|
+
}, (e) => {
|
|
36
|
+
o === n && a({
|
|
37
|
+
...r,
|
|
38
|
+
pending: !1,
|
|
39
|
+
settled: !0,
|
|
40
|
+
error: e
|
|
41
|
+
}), t.error("task run failed", e);
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
runOnce(e) {
|
|
45
|
+
r.pending || r.settled || o.run(e);
|
|
50
46
|
}
|
|
51
47
|
};
|
|
48
|
+
return o;
|
|
49
|
+
}
|
|
50
|
+
function r(e) {
|
|
51
|
+
return typeof e == "object" && !!e && typeof e.run == "function" && typeof e.runOnce == "function" && typeof e.get == "function" && typeof e.subscribe == "function";
|
|
52
|
+
}
|
|
53
|
+
function i(e) {
|
|
54
|
+
return r(e) ? e : n(e);
|
|
52
55
|
}
|
|
53
56
|
//#endregion
|
|
54
|
-
export { r as
|
|
57
|
+
export { n as defineTask, r as isAsyncTask, i as toTask };
|
|
55
58
|
|
|
56
59
|
//# sourceMappingURL=index20.js.map
|