This commit is contained in:
2023-11-14 16:00:55 +08:00
parent dd23d4184d
commit 6481c0bc49
10 changed files with 73 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ const asyncRun = (() => {
return (python: string, input: string) => {
// the id could be generated more carefully
id = (id + 1) % Number.MAX_SAFE_INTEGER
return new Promise<{ result: string; error: string }>((onSuccess) => {
return new Promise<{ results: string[]; error: string }>((onSuccess) => {
callbacks[id] = onSuccess
worker.postMessage({ python, input, id })
})