From e9e6a3bb995218633ee9f4af3b995f762f59c6ee Mon Sep 17 00:00:00 2001 From: msincenselee Date: Sat, 7 Dec 2019 22:08:05 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=8A=9F=E8=83=BD]=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=89=A9=E5=B1=95=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E4=BE=9B=E8=B0=83=E5=BA=A6=E7=AD=89=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=B3=A8=E5=86=8C=E5=85=B6=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/app/rpc_service/engine.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vnpy/app/rpc_service/engine.py b/vnpy/app/rpc_service/engine.py index 5a5fc967..74b0b245 100644 --- a/vnpy/app/rpc_service/engine.py +++ b/vnpy/app/rpc_service/engine.py @@ -1,7 +1,7 @@ """""" import traceback -from typing import Optional +from typing import Optional, Callable from vnpy.event import Event, EventEngine from vnpy.rpc import RpcServer @@ -56,6 +56,11 @@ class RpcEngine(BaseEngine): self.server.register(self.main_engine.get_all_contracts) self.server.register(self.main_engine.get_all_active_orders) + def register(self, func: Callable): + """ 扩展注册接口""" + if self.server: + self.server.register(func) + def load_setting(self): """""" setting = load_json(self.setting_filename)