@superhero/eventflow-spoke 4.4.7 → 4.4.9
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 +1 -1
- package/consume.js +5 -2
- package/index.js +4 -0
- package/package.json +1 -1
package/config.js
CHANGED
package/consume.js
CHANGED
|
@@ -45,9 +45,12 @@ export default class ConsumeService
|
|
|
45
45
|
{
|
|
46
46
|
const
|
|
47
47
|
service = this.#locator.locate(domain),
|
|
48
|
-
consumer = this.#consumer.bind(this, service)
|
|
48
|
+
consumer = this.#consumer.bind(this, service),
|
|
49
|
+
names = Array.isArray(consumerMap[domain])
|
|
50
|
+
? consumerMap[domain]
|
|
51
|
+
:[consumerMap[domain]]
|
|
49
52
|
|
|
50
|
-
for(const name of
|
|
53
|
+
for(const name of names)
|
|
51
54
|
{
|
|
52
55
|
await this.#spoke.consume(domain, name, consumer)
|
|
53
56
|
}
|
package/index.js
CHANGED
|
@@ -147,11 +147,15 @@ export default class Spoke
|
|
|
147
147
|
|
|
148
148
|
// subscribe to all events that are already expected to be subscribed to
|
|
149
149
|
const subscriptions = deepmerge(this.consumers.listeners, this.subscriptions.listeners)
|
|
150
|
+
|
|
151
|
+
this.log.info`subscriptions ${subscriptions}`
|
|
152
|
+
|
|
150
153
|
for(const domain in subscriptions)
|
|
151
154
|
{
|
|
152
155
|
for(const name of subscriptions[domain])
|
|
153
156
|
{
|
|
154
157
|
this.channel.transmit(hub, [ 'subscribe', domain, name ])
|
|
158
|
+
this.log.info`${hubID} subscribes to: ${domain} › ${name}`
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
}
|