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

Expose Internal Functions for Enhanced Usability #166

Closed
cryi opened this issue Oct 25, 2023 · 4 comments
Closed

Expose Internal Functions for Enhanced Usability #166

cryi opened this issue Oct 25, 2023 · 4 comments

Comments

@cryi
Copy link
Contributor

cryi commented Oct 25, 2023

Description

We are looking to build more sophisticated applications on top of the coreHTTP library. Our use case requires support for chunked body reads and writes, streaming, and other advanced HTTP functionalities. However, the current encapsulation of sendHttpHeaders, sendHttpData, receiveAndParseHttpResponse functions restricts our ability to extend or adapt the library to our needs.

Solution

We propose exposing the following internal functions as part of the public API:

  • sendHttpHeaders
  • sendHttpData
  • receiveAndParseHttpResponse

By making these functions accessible, developers can have more control over the HTTP communication process, allowing for more complex use cases, such as handling chunked transfers, streaming data, and more.

Alternatives

Currently, we are patching coreHTTP during the build. This is a relatively easy patch so we can apply it during the build process and use it as if these functions are built into the core library. However, having these functions exposed officially in the library would provide a more robust and community-supported solution.

This is direct evolution of #160.

NOTE: We are right now testing this on portion of our production services as replacement for libcurl. We managed to drop binary size by ~30% while maintaining feature set.

@cryi
Copy link
Contributor Author

cryi commented Oct 25, 2023

I have created a PR #167 featuring a sample implementation. Please let me know if it is acceptable in its current or any alternate form, or what changes are required. At the moment, it lacks proper commenting and formatting; I will make the necessary adjustments once we agree on the final form of the implementation.

@archigup
Copy link
Member

archigup commented Nov 2, 2023

Hi, sorry for the delay.

Exposing those functions sounds good to me, though will need documentation.

I'll continue discussion on the PR.

@archigup
Copy link
Member

archigup commented Nov 9, 2023

Thanks, closing this issue as #167 was merged.

@archigup archigup closed this as completed Nov 9, 2023
@cryi
Copy link
Contributor Author

cryi commented Nov 20, 2023

For reference: we use it in lua-corehttp.

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

No branches or pull requests

2 participants