@superhero/eventflow-spoke 4.3.2 → 4.3.4

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 (3) hide show
  1. package/config.js +7 -5
  2. package/index.js +8 -3
  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' : true,
9
- '@superhero/eventflow-spoke/consume' : true
8
+ '@superhero/eventflow-spoke' : true,
9
+ '@superhero/eventflow-spoke/consume' : true
10
10
  },
11
11
  dependency:
12
12
  {
13
- '@superhero/eventflow-db' : true
13
+ '@superhero/eventflow-certificates' : true,
14
+ '@superhero/eventflow-db' : true
14
15
  },
15
16
  locator:
16
17
  {
17
- '@superhero/eventflow-spoke' : true,
18
- '@superhero/eventflow-spoke/consume' : true
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
- config = locator.config.find('eventflow/spoke'),
15
- db = locator.locate('@superhero/eventflow-db')
16
+ certificates = locator.config.find('eventflow/certificates', {}),
17
+ config = locator.config.find('eventflow/spoke', { certificates }),
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
- // setTimeout(() => this.db.close(), 5000)
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.2",
3
+ "version": "4.3.4",
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.0",
20
- "@superhero/eventflow-db": "^4.3.2",
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.2"
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",