egg icon indicating copy to clipboard operation
egg copied to clipboard

请问是否能实现非web(不监听端口,不提供web服务)方式启动

Open zdt1013 opened this issue 2 years ago • 1 comments

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

egg的架构用起来很方便,但是有些需求想用egg来做,但是又不是web应用,比如监听kafka数据写入到数据库,读取数据库处理数据等,请问有什么方式可以实现?还是说目前不支持非web方式应用此框架?

可复现问题的仓库地址(Reproduction Repo)

暂无

Node 版本号:

16.17.2

Eggjs 版本号:

3

相关插件名称与版本号(PlugIn and Name):

egg-mysql

操作平台与版本号(Platform and Version):

mac os

zdt1013 avatar Apr 13 '23 06:04 zdt1013

可以参考 egg-cluster 的实现,自定义一个启动器,覆盖 startMasterSocketServer 默认实现即可。 https://github.com/eggjs/egg-cluster/blob/master/lib/master.js#L234

fengmk2 avatar Apr 16 '23 06:04 fengmk2