-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(platform): report message rejection of asynchronous interceptors …
…back to the sender closes #147 BREAKING CHANGE: Fixing message rejection reporting of interceptors introduced a breaking change in the Interceptor API. In order to report asynchronous message rejection correctly, the Interceptor API has been refactored from synchronous to asynchronous message interception. To migrate, change the return type of your interceptors from `void` to `Promise<void>` and update the method body accordingly. ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public intercept(message: TopicMessage, next: Handler<TopicMessage>): void { console.log(message); // Passes the message along the interceptor chain. next.handle(message); } } ``` #### After migration ```typescript class MessageLoggerInterceptor implements MessageInterceptor { public async intercept(message: TopicMessage, next: Handler<TopicMessage>): Promise<void> { console.log(message); // Passes the message along the interceptor chain. await next.handle(message); } } ```
- Loading branch information
Showing
9 changed files
with
149 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.