Skip to content

Commit afe832e

Browse files
committedJun 2, 2020
await hooks
1 parent f0a185b commit afe832e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/bus-core/src/service-bus/service-bus.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class ServiceBus implements Bus {
4040
this.logger.debug('publish', { event })
4141
const transportOptions = this.prepareTransportOptions(messageOptions)
4242

43-
this.messageHooks.publish.map(callback => callback(event, messageOptions))
43+
await Promise.all(this.messageHooks.publish.map(callback => callback(event, messageOptions)))
4444
return this.transport.publish(event, transportOptions)
4545
}
4646

@@ -51,7 +51,7 @@ export class ServiceBus implements Bus {
5151
this.logger.debug('send', { command })
5252
const transportOptions = this.prepareTransportOptions(messageOptions)
5353

54-
this.messageHooks.send.map(callback => callback(command, messageOptions))
54+
await Promise.all(this.messageHooks.send.map(callback => callback(command, messageOptions)))
5555
return this.transport.send(command, transportOptions)
5656
}
5757

0 commit comments

Comments
 (0)
Please sign in to comment.