forked from Blendman974/faceclaw
Clean up unused worker threads for closed apps; other performance optimizations
This commit is contained in:
1 parent
9560f3ac8d
commit
2e4d20e130
20 files changed
+360
-13
No files matched your search
@@ -25,6 +25,7 @@
|
||||
* focus to the sidebar) pauses, as does backgrounding or screen-off.
|
||||
*/
|
||||
import "@nativescript/core/globals";
|
||||
import { finishWorkerShutdown } from "../../ui/shell/worker-lifecycle";
|
||||
import { GrayImage } from "../../graphics/image";
|
||||
import { flattenPlanesWithDraws, planesFingerprint, type Plane } from "../../graphics/plane";
|
||||
import { prepareFrameDraws } from "../../graphics/glyph-wire";
|
||||
@@ -180,6 +181,12 @@ post({ type: "worker-ready" });
|
||||
global.onmessage = (event: { data: WorkerAppMessage }) => {
|
||||
const message = event.data;
|
||||
switch (message.type) {
|
||||
case "check-idle":
|
||||
post({ type: "worker-idle" });
|
||||
break;
|
||||
case "shutdown":
|
||||
finishWorkerShutdown();
|
||||
break;
|
||||
case "open-window": {
|
||||
const window: FlappyWindow = {
|
||||
windowId: message.windowId,
|
||||
|
||||
Reference in new issue
Block a user