-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shuttle): Support running before/after hooks when processing eve…
…nts (#2176) ## Why is this change needed? We want the ability to provide custom pre/post-processing logic when processing events. Expose optional hooks that can be specified. This has the added benefit that the `beforeProcess` hook can be used to skip processing of an event. ## Merge Checklist - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [ ] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [x] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR enhances the `@farcaster/shuttle` package by adding support for running before/after hooks when processing events. ### Detailed summary - Added `beforeProcess` and `afterProcess` handlers to `EventStreamHubSubscriber` and `HubEventStreamConsumer` - Implemented handling of preprocess and postprocess actions for event processing - Introduced `EventStreamHubSubscriberOptions` and `EventStreamConsumerOptions` interfaces - Updated `HubEventStreamConsumer` to extend `TypedEmitter` for custom event tracking > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
3 changed files
with
60 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@farcaster/shuttle": patch | ||
--- | ||
|
||
Add support for running before/after hooks when processing events |
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