Bug 2018675 - Do not use a callback interface for MetricsHandler#7239
Queued
freshstrangemusic wants to merge 1 commit intomainfrom
Queued
Bug 2018675 - Do not use a callback interface for MetricsHandler#7239freshstrangemusic wants to merge 1 commit intomainfrom
freshstrangemusic wants to merge 1 commit intomainfrom
Conversation
Using a callback interface forces the type to come in as `Box<T>` instead of `Arc<T>` as a regular interface. We're storing it as an `Arc<Box<T>>` because we need it to be `Send`, so using a plain interface allows us to drop the `Box` and store a `Arc<T>` directly, preventing an additional layer of indirection. Because the MetricsHandler is in an Arc, we can keep an `Arc<TestMetrics>` around and use it directly instead of dowcasting the reference inside `Arc<dyn MetricsHandler>` and so we can remove the `NimbusClient::get_metrics_handler()` test method.
4c6f95c to
e317c0c
Compare
5 tasks
relud
approved these changes
Feb 23, 2026
Any commits made after this event will not be merged.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using a callback interface forces the type to come in as
Box<T>instead ofArc<T>as a regular interface. We're storing it as anArc<Box<T>>because we need it to beSend, so using a plain interface allows us to drop theBoxand store aArc<T>directly, preventing an additional layer of indirection.Because the MetricsHandler is in an Arc, we can keep an
Arc<TestMetrics>around and use it directly instead of dowcasting the reference insideArc<dyn MetricsHandler>and so we can remove theNimbusClient::get_metrics_handler()test method.Pull Request checklist
[ci full]to the PR title.