Skip to content

refactor: Improve send method ergonomics #1717

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frankomosh
Copy link

#1695

Created separate sender struct to hold the sender channel and removed sender field from main struct. Then updated methods to accept sender as a parameter, eliminating mutex locks in the message sending path. The changes hopefully improve ergonomics and reduce lock contention when sending messages.

Created separate sender struct to hold the sender channel and removed sender field from main struct. Then updated methods to accept sender as a parameter, eliminating mutex locks in the message sending path.  The changes hopefully improve ergonomics and reduce lock contention when sending messages.
@frankomosh frankomosh marked this pull request as draft May 21, 2025 06:54
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 21.32%. Comparing base (a8030f9) to head (8a3b40b).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
roles/jd-client/src/lib/template_receiver/mod.rs 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1717      +/-   ##
==========================================
+ Coverage   21.20%   21.32%   +0.12%     
==========================================
  Files         134      134              
  Lines       10000     9936      -64     
==========================================
- Hits         2120     2119       -1     
+ Misses       7880     7817      -63     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_sv2-coverage 10.26% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 37.68% <ø> (ø)
codec_sv2-coverage 0.03% <ø> (ø)
common_messages_sv2-coverage 0.25% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.54% <ø> (ø)
jd_client-coverage 0.39% <0.00%> (-0.01%) ⬇️
jd_server-coverage 12.67% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 3.61% <ø> (ø)
mining-coverage 5.05% <ø> (-0.04%) ⬇️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 1.18% <ø> (ø)
noise_sv2-coverage 8.74% <ø> (ø)
pool_sv2-coverage 5.92% <0.00%> (+0.07%) ⬆️
protocols 30.43% <ø> (-0.03%) ⬇️
roles 11.64% <0.00%> (+0.14%) ⬆️
roles_logic_sv2-coverage 15.33% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.49% <ø> (+0.41%) ⬆️
utils 36.39% <ø> (ø)
v1-coverage 4.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frankomosh frankomosh marked this pull request as ready for review May 21, 2025 07:02
@frankomosh frankomosh marked this pull request as draft May 21, 2025 07:05
@Shourya742
Copy link
Contributor

Hey @frankomosh , the approach looks ok to me, are you still working on it?

@frankomosh
Copy link
Author

Hey @frankomosh , the approach looks ok to me, are you still working on it?

Hi @Shourya742, Yes, I'm still working on it. Along the way have discoveerd that there are breaking changes as several modules (upstream_sv2, downstream.rs, job_declarator/mod.rs, etc.) have to be updated. Do you think a phased refactor is necessary or just do everything in one pr is okey?

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