Replace onAttach / onDetach context event pair with onUpdate(before, after)#11859
Replace onAttach / onDetach context event pair with onUpdate(before, after)#11859mcculls wants to merge 1 commit into
onAttach / onDetach context event pair with onUpdate(before, after)#11859Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: c0c3c75 | Docs | Datadog PR Page | Give us feedback! |
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
4d37ba4 to
1c76b54
Compare
1c76b54 to
c0c3c75
Compare
PerfectSlayer
left a comment
There was a problem hiding this comment.
Looking good! I like the fact there is no longer a "before" event (onDettach) so all notifications happen after the related context event is resolved.
| try (ContextScope scope = context.attach()) { | ||
| continuation = context.capture(); // capture while active | ||
| continuation.hold(); | ||
| listener.assertNewEvents("update:{root}->value", "capture:value"); |
There was a problem hiding this comment.
👏 praise: Like the fact the events moved near where they happen. The tests are stricter and easier to read 👍
Motivation
Reduces event cost while allowing listeners to detect the difference between updates to/from
rootand those updating from one non-root context to another.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)Jira ticket: [PROJ-IDENT]