-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add hook-data concept for hooks. (#273)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> Add support for the hook-data concept for hooks. Hook-data allows for per-evaluation data to be propagated between hooks. This is especially useful for analytics purposes where you may want to measure things that happen between stages, or you want to do something like create a span in one stage and close it in another. This concept is similar to the `series data` concept for LaunchDarkly hooks. https://github.com/launchdarkly/open-sdk-specs/tree/main/specs/HOOK-hooks#evaluationseriesdata Unlike `series data` the data in this approach is mutable. This is because the `before` stage already has a return value. We could workaround this by specifying a return structure, but it maybe seems more complex. The data is only passed to a specific hook instance, so mutability is not of great concern. Some functional languages may still need to use an immutable with return values approach. I can create an OFEP if we think this merits discussion prior to proposal. ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> Related discussion in a PR comment. open-feature/java-sdk#1049 (comment) --------- Signed-off-by: Ryan Lamb <[email protected]> Co-authored-by: Michael Beemer <[email protected]> Co-authored-by: Lukas Reining <[email protected]> Co-authored-by: Todd Baert <[email protected]>
- Loading branch information
1 parent
d261f68
commit c287b58
Showing
2 changed files
with
126 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
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