static long dm_evalOnOtherMachineWithReturnValue_timeout = 60000; sO dm_evalOnOtherMachineWithReturnValue(fS computerID, S code, O... _) { fS id = aGlobalID(); final new Var<Either<O, S>> var; temp vmBus_onMessage('gotFromPrivateChat, voidfunc(S sender, S msg) { if (var.has() || neq(sender, computerID)) ret; new Matches m; if (!startsWith(msg, "done " + id + " ", m)) ret; if (neq(getAuthorOfSignedText(msg), computerID)) { File f = javaxCachesDir("failed-eval-msg-" + computerID); saveTextFile(f, msg); var.set((Either) eitherB("eval result from " + computerID + " did not verify, saved as " + f)); } S s = firstLine(m.rest()); if (startsWith(s, "direct: ", m)) var.set((Either) eitherA(m.rest())); else if (startsWith(s, "quoted: ", m)) var.set((Either) eitherA(unquote(m.rest()))); else if (startsWith(s, "base64: ", m)) var.set((Either) eitherA(base64decode(m.rest()))); else if (startsWith(s, "error: ", m)) var.set((Either) eitherB(m.rest())); else var.set((Either) eitherB("unknown mode")); }); dm_privateChat_sendSigned(computerID, computerID + " eval " + (boolOptPar(_, 'realEval) ? "real " : "") + (boolOptPar(_, 'fresh) ? "fresh " : "") + id + ": " + code); Either<O, S> e = waitForVarToBeNotNullWithTimeout(var, dm_evalOnOtherMachineWithReturnValue_timeout); if (boolPar updateControllableFlag(_)) dm_pcall('controllableComputerList, 'setControllableByMe, computerID, eitherIsA(e)); if (e == null) fail("timeout"); if (eitherIsB(e)) fail(eitherGetB(e)); ret eitherGetA(e); }
Began life as a copy of #1019606
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, snaazhdonpnp, tvejysmllsmz, vouqrxazstgt, wnsclhtenguj, xrpafgyirdlv
No comments. add comment