根据 https://eggjs.org/zh-cn/basics/objects.html
Application 是全局应用对象,在一个应用中,只会实例化一个,它继承自 Koa.Application,在它上面我们可以挂载一些全局的方法和对象。我们可以轻松的在插件或者应用中扩展 Application 对象
在win7环境测试时发现对于 this.app 添加的属性(Map对象)与 process.pid 有关。在多进程模式下只有创建这个map对象的pid访问此属性才能获得正确的值,其他进程访问结果为空。
这是win平台下eggjs实现多进程模式的问题么?
Translation of this issue:
According to https://eggjs.org/zh-cn/basics/objects.html
Application is a global application object. In an application, only one instance is instantiated. It inherits from Koa.Application. Above it we can mount some global methods and objects. We can easily extend Application objects in plugins or applications
Found in the win7 environment test for this.app added properties (Map object) and process.pid related. In the multi-process mode, only the pid that created the map object can access this property to obtain the correct value. The result of other process access is empty.
This is the problem of multi-process mode of eggjs under win platform?
了解下 Node 多进程 的概念。
文档指的是在进程内唯一
Application 是全局应用对象,在一个应用中,只会实例化一个
文档有歧义
了解下 Node 多进程 的概念。
文档指的是在进程内唯一
这个歧义有点大
踩坑的报个到,

应用内唯一和进程内唯一,程序猿不应该这么不严谨吧!!
作用域一个是进程内,一个是全局,使用场景和概念完全不同好吧。
@atian25 希望官方能修正一下文档,避免新手踩坑,另外有办法提供一个全局唯一的容器对象吗?
Most helpful comment
Application 是全局应用对象,在一个应用中,只会实例化一个
文档有歧义