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 generic component client http #334

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

uriel-starkware
Copy link
Contributor

@uriel-starkware uriel-starkware commented Jul 1, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.64%. Comparing base (d7017e8) to head (45db391).
Report is 10 commits behind head on main.

Files Patch % Lines
crates/mempool_infra/src/component_client.rs 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
- Coverage   83.98%   82.64%   -1.35%     
==========================================
  Files          28       31       +3     
  Lines        1374     1596     +222     
  Branches     1374     1596     +222     
==========================================
+ Hits         1154     1319     +165     
- Misses        161      216      +55     
- Partials       59       61       +2     

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

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @uriel-starkware)


crates/mempool_infra/src/component_client.rs line 62 at r1 (raw file):

where
    Request: Serialize,
    Response: for<'a> Deserialize<'a>,

Please add the bounds to the struct definition as well.

Code quote:

where
    Request: Serialize,
    Response: for<'a> Deserialize<'a>,

@uriel-starkware uriel-starkware force-pushed the uriel/generic-component-client-http branch from 5e8ff05 to 5b2b9f6 Compare July 1, 2024 13:28
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @uriel-starkware)


crates/mempool_infra/tests/component_server_client_http_test.rs line 197 at r1 (raw file):

    let a_client = ComponentClientHttp::new(local_ip, a_port);
    let b_client = ComponentClientHttp::new(local_ip, b_port);

Is there a way to explicitly mention the types of these two? Currently they are implicilty inferred from the initation of the components.

Something in the sorts of

    let a_client = ComponentClientHttp<RequestA,ResponseA>::new(local_ip, a_port);

Code quote:

    let a_client = ComponentClientHttp::new(local_ip, a_port);
    let b_client = ComponentClientHttp::new(local_ip, b_port);

Copy link
Contributor Author

@uriel-starkware uriel-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion


crates/mempool_infra/src/component_client.rs line 62 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please add the bounds to the struct definition as well.

Done.


crates/mempool_infra/tests/component_server_client_http_test.rs line 197 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Is there a way to explicitly mention the types of these two? Currently they are implicilty inferred from the initation of the components.

Something in the sorts of

    let a_client = ComponentClientHttp<RequestA,ResponseA>::new(local_ip, a_port);

there is always the option to write them as ComponentClientHttp<ComponentARequest, ComponentAResponse>. Tell me if this is what you want. I will do it to server as well

@uriel-starkware uriel-starkware force-pushed the uriel/generic-component-client-http branch from 5b2b9f6 to 45db391 Compare July 1, 2024 13:41
Copy link
Contributor Author

@uriel-starkware uriel-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)


crates/mempool_infra/tests/component_server_client_http_test.rs line 197 at r1 (raw file):

Previously, uriel-starkware wrote…

there is always the option to write them as ComponentClientHttp<ComponentARequest, ComponentAResponse>. Tell me if this is what you want. I will do it to server as well

Ok, I did it as I described

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

:lgtm:

Reviewed 1 of 3 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @uriel-starkware)

@uriel-starkware uriel-starkware merged commit 6ec0d90 into main Jul 1, 2024
8 checks passed
@uriel-starkware uriel-starkware deleted the uriel/generic-component-client-http branch July 1, 2024 13:49
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.

3 participants