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: async http calls from component and bugfixes #84

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

SachaMorard
Copy link
Contributor

@SachaMorard SachaMorard commented Oct 1, 2024

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

This pull request introduces the implementation of data collection components using WebAssembly (Wasm) and enhances the payload processing logic. The changes are primarily focused on the src/proxy/compute/data_collection/components.rs file.

  • Implemented the initialization of Wasm components for data collection.
  • Added the send_data_collection function to handle data collection http calls asynchronously.
  • Introduced the anonymize_ip function to anonymize client IP addresses.
  • Defined the HostView struct to manage Wasm context and resources.
  • Remove x-forwarded-for from the wit protocol, because it's not useful

Related Issues

no issue

Copy link
Contributor

@KokaKiwi KokaKiwi left a comment

Choose a reason for hiding this comment

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

I feel like the whole "data collection" code should be the one being put in an async task instead of all the small bits (HTTP requests, etc.) since it's literally a "side-effect"
But that would probably require a lot more refactoring (cf. comment about cleaning up the payload conversion code) which maybe should be done in a dedicated cleanup PR?

@KokaKiwi
Copy link
Contributor

KokaKiwi commented Oct 1, 2024

Oh also the formatting seems odd, as in: there's a lot of code reformatting being done in this PR despite the cargo fmt previously done in #80, is that something from RustRover doing its own formatting rules?

@SachaMorard
Copy link
Contributor Author

Oh also the formatting seems odd, as in: there's a lot of code reformatting being done in this PR despite the cargo fmt previously done in #80, is that something from RustRover doing its own formatting rules?

I don't think so. I use cargo fmt manually to be sure the last pushed commit is correctly formatted

@SachaMorard SachaMorard merged commit ec41f5f into main Oct 2, 2024
2 checks passed
@SachaMorard SachaMorard deleted the feat/async-components branch October 2, 2024 12:30
@KokaKiwi
Copy link
Contributor

KokaKiwi commented Oct 2, 2024

I don't think so. I use cargo fmt manually to be sure the last pushed commit is correctly formatted

Uh. Do you maybe have a custom rustfmt.toml config file? Or maybe a different Rust version?

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