aboutsummaryrefslogtreecommitdiff
path: root/web/http/worker.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'web/http/worker.mjs')
-rw-r--r--web/http/worker.mjs14
1 files changed, 8 insertions, 6 deletions
diff --git a/web/http/worker.mjs b/web/http/worker.mjs
index d912e8b..0c1acb9 100644
--- a/web/http/worker.mjs
+++ b/web/http/worker.mjs
@@ -1,14 +1,16 @@
1import Nissy from "./nissy_web_module.mjs" 1import Nissy from "./nissy_web_module.mjs"
2 2
3const nissy = await Nissy(); 3const nissy = await Nissy();
4const log = (msg) => postMessage({ command: "log", id: -1, object: msg });
5nissy.setLogger(nissy._addCallbackFunction(log));
6 4
7var solveStatus = nissy.statusRUN; // For now this is a global variable 5const log = (cstr) => postMessage({
8const pollStatusCallback = nissy._addCallbackFunction(() => { 6 command: "log", id: -1,
9console.log("Calling pollstatus, returning " + solveStatus); 7 object: nissy.UTF8ToString(cstr)
10return solveStatus;
11}); 8});
9nissy.setLogger(nissy.addFunction(log, "vp"));
10
11var solveStatus = nissy.statusRUN; // For now this is a global variable
12const pollStatus = () => solveStatus;
13const pollStatusCallback = nissy.addFunction(pollStatus, "i");
12 14
13const commands = [ 15const commands = [
14 { name: "load solver data", exec: loadSolverDataFromStorage }, 16 { name: "load solver data", exec: loadSolverDataFromStorage },

Generated with cgit - Back to sebastiano.tronto.net