From 0ee6430c63233c2ee23ab03d510ce5768d6c39bb Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:59:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20action=E5=9F=BA=E7=A1=80=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/worker/action/worker.action.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 typescript/core/worker/action/worker.action.ts diff --git a/typescript/core/worker/action/worker.action.ts b/typescript/core/worker/action/worker.action.ts new file mode 100644 index 000000000..6a581fd9f --- /dev/null +++ b/typescript/core/worker/action/worker.action.ts @@ -0,0 +1,28 @@ +import type WorkerBaseController from "../controller/worker.controller"; + +/** + * 事务的基类 + */ +export default abstract class WorkerBaseAction { + /** + * 通信控制器 + */ + protected controller: WorkerBaseController; + + /** + * 线程上的 action 集合, 用于调用其他命名空间下的事务 + */ + protected threadAction: any; + + public constructor(controller: WorkerBaseController, threadAction: any) { + this.controller = controller; + this.threadAction = threadAction; + + this.addActionHandler(); + } + + /** + * 添加事务的处理器 + */ + protected abstract addActionHandler(): void; +}