-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hooks before and after certain operations. (#67)
* Add hooks before and after certain operations. This is with the intention of using these hooks for registering instrumentation wrappers for publish and subscribe flows. * Test hooks. * Documentation. * 0.16.0 * run formatting * Change some tests. * Add documentation and change object to map. * Hooks never throw, and instead the callbacks can return `false` in order to cancel certain operations. * Clean `getCorrelationId`. * Test and fix hook cancellation stuff. * Remove unneeded `await`. * Read 'logger' from it's own file instead directly from config. * Freeze configuration object. * Remove hooks from configuration object. Since the configuration object changes every time the connection is constructed, it doesn't make sense to have the hooks there. * Clean logger initialization. * Allow wrapping the consumer callback inside the hook. Required in order to pass instrumentation context into the callback. * Remove flow interruption option through hooks. * Initialize connection before invoking producer hooks. This makes sure the `beforePublish` hook is never called before the connection hooks. * Fix renaming hook I missed. * Fix unregister hooks. * Trigger after try-catch where applicable to simplify code.
- Loading branch information
Showing
17 changed files
with
818 additions
and
85 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.