RUM-13610: Create a class to handle thread-safe state updates with notification - #3743
Conversation
4e3ff24 to
dba04ae
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e3ff245f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 325fea4 | Docs | View more details | Give us feedback! |
…tification Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dba04ae to
325fea4
Compare
| return try { | ||
| subscription.notifyListeners { onStateChanged(newState) } | ||
| null | ||
| } catch (e: Throwable) { |
There was a problem hiding this comment.
Q: do we want to catch all the Throwable here? for example OOM, we might want it to be propagated instead of being caught as a notify failure?
What does this PR do?
This PR extracts (with some improvements) the class to handle state updates with listeners attached.
The new class is using
DDCoreSubscriptionunder the hood to manage subscriptions and adds state management on top of it.Review checklist (to be filled by reviewers)