Skip to content

Pool easy handles? #13

Open
Open

Description

@armanbilge

https://github.com/typelevel/keypool

Easy handles are meant and designed to be reused. When you have done a single transfer with the easy handle, you can immediately use it again for your next transfer.

https://everything.curl.dev/libcurl/easyhandle#reuse

After the transfer has been made, you can set new options and make another transfer, or if you are done, cleanup the session by calling curl_easy_cleanup. If you want persistent connections, you do not cleanup immediately, but instead run ahead and perform other transfers using the same easy handle.

https://curl.se/libcurl/c/libcurl-easy.html

Sounds like a mistake that we're not reusing these 😅

Activity

  1. armanbilge commented on Aug 25, 2022

    @armanbilge
    MemberAuthor

    Keypool is not published for Native yet, but I can bootleg it real quick if someone wants to work on this. Just ping me :)

  2. armanbilge commented on Aug 30, 2022

    @armanbilge
    MemberAuthor

    Actually I don't think this is so necessary after all, since we are using the multi API. The multi-handle will maintain the connection pool

    When you are using the multi API, the connection pool is instead kept associated with the multi handle. This allows you to cleanup and re-create easy handles freely without risking losing the connection pool, and it allows the connection used by one easy handle to get reused by a separate one in a later transfer. Just reuse the multi handle!

    https://everything.curl.dev/libcurl/connectionreuse

    Using a pool to reuse easy-handles may still be useful from a memory allocation perspective? But a pool adds overhead too.

  3. changed the title [-]Use keypool for caching easy handles[/-] [+]Pool easy handles?[/+] on Aug 30, 2022
  4. added
    questionFurther information is requested
    and removed
    enhancementNew feature or request
    help wantedExtra attention is needed
    on Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions