pwi-plata-type 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/libs/cluster.ts +16 -14
  2. package/package.json +1 -1
package/libs/cluster.ts CHANGED
@@ -86,7 +86,7 @@ export class PlataClusterManager {
86
86
  }
87
87
 
88
88
  if (this.Cluster.eventNames().indexOf('message') === -1) {
89
- this.Cluster.on('message', this._clusterMsgServer)
89
+ this.Cluster.on('message', this._clusterMsgServer(this))
90
90
  }
91
91
  }
92
92
  }
@@ -179,19 +179,21 @@ export class PlataClusterManager {
179
179
  }
180
180
  }
181
181
 
182
- private async _clusterMsgServer(_worker: typeCluster.Worker, msg: PlataClusterMsg) {
183
- if (msg.name !== '_plata') {
184
- // TODO :::
185
- } else {
186
- switch(msg.data.action) {
187
- case 'KILL':
188
- console.log('Solicitado kill do app')
189
- process.exit(0)
190
- ;
191
- case 'ECHO':
192
- this.sendAllWorkers(msg.data.msg)
193
- return
194
- ;
182
+ private _clusterMsgServer(t: PlataClusterManager) {
183
+ return async (_worker: typeCluster.Worker, msg: PlataClusterMsg) => {
184
+ if (msg.name !== '_plata') {
185
+ // TODO :::
186
+ } else {
187
+ switch(msg.data.action) {
188
+ case 'KILL':
189
+ console.log('Solicitado kill do app')
190
+ process.exit(0)
191
+ ;
192
+ case 'ECHO':
193
+ t.sendAllWorkers(msg.data.msg)
194
+ return
195
+ ;
196
+ }
195
197
  }
196
198
  }
197
199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwi-plata-type",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "main": "index.ts",
5
5
  "bin": {
6
6
  "plata": "bin/plata.ts",