checkpoint

This commit is contained in:
Stewart Allen 2023-01-09 19:56:58 -05:00
commit 4ec8f845c5
5 changed files with 149 additions and 80 deletions

View file

@ -10,8 +10,8 @@
// dep: geo.wasm
// dep: kiri.codec
// dep: kiri-mode.fdm.post
// dep: kiri-mode.cam.topo
// use: kiri-mode.cam.slicer
// dep: kiri-mode.cam.slicer2
// dep: ext.clip2
gapp.register("kiri-run.minion", [], (root, exports) => {
@ -142,12 +142,12 @@ const funcs = self.minion = {
putCache: msg => {
const { key, data } = msg;
log({ minion_putCache: key, data });
// log({ minion_putCache: key, data });
if (data) {
console.log({ minion_put_cache: key, data });
// console.log({ minion_put_cache: key, data });
cache[key] = data;
} else {
console.log({ minion_del_cache: key });
// console.log({ minion_del_cache: key });
delete cache[key];
}
},
@ -169,6 +169,6 @@ const funcs = self.minion = {
}
};
moto.broker.publish("minion.started", funcs);
moto.broker.publish("minion.started", { funcs, cache, reply, log });
});

View file

@ -73,7 +73,13 @@ function minhandler(msg) {
// for concurrent operations
const minwork =
kiri.minions = {
concurrent,
get concurrent() {
return concurrent
},
get running() {
return minions.length;
},
start() {
if (minions.length || !concurrent) {
@ -625,7 +631,7 @@ kiri.worker = {
putCache(msg, send) {
const { key, data } = msg;
console.log({ worker_putCache: key, data });
// console.log({ worker_putCache: key, data });
if (data) {
pcache[key] = data;
} else {