@superhero/eventflow-spoke 4.3.2 → 4.3.3
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.
- package/config.js +7 -5
- package/index.js +8 -3
- package/package.json +4 -4
package/config.js
CHANGED
|
@@ -5,18 +5,20 @@ export default
|
|
|
5
5
|
{
|
|
6
6
|
bootstrap:
|
|
7
7
|
{
|
|
8
|
-
'@superhero/eventflow-spoke'
|
|
9
|
-
'@superhero/eventflow-spoke/consume'
|
|
8
|
+
'@superhero/eventflow-spoke' : true,
|
|
9
|
+
'@superhero/eventflow-spoke/consume' : true
|
|
10
10
|
},
|
|
11
11
|
dependency:
|
|
12
12
|
{
|
|
13
|
-
'@superhero/eventflow-
|
|
13
|
+
'@superhero/eventflow-certificates' : true,
|
|
14
|
+
'@superhero/eventflow-db' : true
|
|
14
15
|
},
|
|
15
16
|
locator:
|
|
16
17
|
{
|
|
17
|
-
'@superhero/eventflow-spoke'
|
|
18
|
-
'@superhero/eventflow-spoke/consume'
|
|
18
|
+
'@superhero/eventflow-spoke' : true,
|
|
19
|
+
'@superhero/eventflow-spoke/consume' : true
|
|
19
20
|
},
|
|
21
|
+
destroy: { '@superhero/eventflow-db' : false },
|
|
20
22
|
eventflow:
|
|
21
23
|
{
|
|
22
24
|
spoke:
|
package/index.js
CHANGED
|
@@ -8,11 +8,14 @@ import CertificatesManager from '@superhero/eventflow-certificates'
|
|
|
8
8
|
import HubsManager from '@superhero/eventflow-spoke/manager/hubs'
|
|
9
9
|
import ListenersManager from '@superhero/eventflow-spoke/manager/listeners'
|
|
10
10
|
|
|
11
|
+
const sleep = (ms) => new Promise((accept) => setTimeout(accept, ms))
|
|
12
|
+
|
|
11
13
|
export function locate(locator)
|
|
12
14
|
{
|
|
13
15
|
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
certifications = locator.config.find('eventflow/certificates', {}),
|
|
17
|
+
config = locator.config.find('eventflow/spoke', { certifications }),
|
|
18
|
+
db = locator.locate('@superhero/eventflow-db')
|
|
16
19
|
|
|
17
20
|
return new Spoke(config, db)
|
|
18
21
|
}
|
|
@@ -75,7 +78,9 @@ export default class Spoke
|
|
|
75
78
|
|
|
76
79
|
this.hubs.destroy()
|
|
77
80
|
this.log.warn`destroyed`
|
|
78
|
-
|
|
81
|
+
|
|
82
|
+
await sleep(1e3)
|
|
83
|
+
await this.db.close()
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
async #pollOnlineHubs()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superhero/eventflow-spoke",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "Eventflow spoke is the client component in the eventflow ecosystem.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eventflow",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@superhero/deep": "^4.2.0",
|
|
19
|
-
"@superhero/eventflow-certificates": "^4.3.
|
|
20
|
-
"@superhero/eventflow-db": "^4.3.
|
|
19
|
+
"@superhero/eventflow-certificates": "^4.3.3",
|
|
20
|
+
"@superhero/eventflow-db": "^4.3.3",
|
|
21
21
|
"@superhero/id-name-generator": "^4.0.0",
|
|
22
22
|
"@superhero/log": "^4.0.1",
|
|
23
23
|
"@superhero/tcp-record-channel": "^4.2.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@superhero/locator": "^4.2.5",
|
|
27
|
-
"@superhero/eventflow-hub": "^4.3.
|
|
27
|
+
"@superhero/eventflow-hub": "^4.3.3"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"test-build": "npm explore @superhero/eventflow-db -- npm run test-build",
|