Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make MethodWeights cheap clone #193

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

yjhmelody
Copy link
Contributor

@yjhmelody yjhmelody commented Jun 24, 2024

See

        // This state is cloned for every connection
        // all these types based on Arcs and it should
        // be relatively cheap to clone them.
        //
        // Make sure that nothing expensive is cloned here
        // when doing this or use an `Arc`.
        #[derive(Clone)]
        struct PerConnection<RpcMiddleware, HttpMiddleware> {
            methods: Methods,
            stop_handle: StopHandle,
            rpc_metrics: RpcMetrics,
            svc_builder: TowerServiceBuilder<RpcMiddleware, HttpMiddleware>,
            rate_limit_builder: Option<Arc<RateLimitBuilder>>,
            rpc_method_weights: MethodWeights,
        }

@xlc xlc merged commit ac19fef into AcalaNetwork:master Jun 24, 2024
2 checks passed
@yjhmelody yjhmelody deleted the arc-method-weights branch June 24, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants