Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use async requests instead of future.apply #35

@szymanskir

Description

@szymanskir

Description: Due to the way how the HN API is constructed the retrieval of comments using the get_comments function is slow. It was sped up by using the future.apply package, but an alternative would be making a group of asynchronous requests.

Currently httr does not support async requests link

There are other libraries that provide support for async requests:

  • curl
  • crul

The goal is to check whether asynchronous requests would be faster than using future.apply, if so the target library for making http requests needs to be selected. This is a pretty significant decision as it will probably result in a rewrite of tests that use httptest
which is tightly integrated with httr.

Moreover, switching to asynchronous requests would allow to reduce the amount of dependencies as future.apply will not be needed anymore.

Acceptance criteria:

  • Benchmarks on whether asynchronous requests speed up the get_comments function
  • Depending on the results define next steps in form of issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions