feat(core): new worker workspace engine (#9257)

This commit is contained in:
EYHN
2025-01-17 00:22:18 +08:00
committed by GitHub
parent 7dc470e7ea
commit a2ffdb4047
219 changed files with 4267 additions and 7194 deletions
+4 -2
View File
@@ -134,7 +134,9 @@ export abstract class AutoMessageHandler {
private listening = false;
protected abstract handlers: Partial<MessageHandlers>;
constructor(protected readonly port: MessageCommunicapable) {}
constructor(protected readonly port: MessageCommunicapable) {
this.listen();
}
protected handleMessage = ignoreUnknownEvent((msg: Messages) => {
const handler = this.handlers[msg.type];
@@ -145,7 +147,7 @@ export abstract class AutoMessageHandler {
handler(msg as any);
});
listen() {
protected listen() {
if (this.listening) {
return;
}