Skip to content

Completion Handler for Async Downloads? #53

@Fishwaldo

Description

@Fishwaldo

With the current design of returning the response class as a Future in the client.get, it effectively negates any benefit of the Async abilities, as you still have to sit there polling the future to determine when the transfers are complete.

It would be great if you could add something like client.async_wait() to cpp-netlib so that we can get a call back when the download is completed.

(I'm guessing the async_wait could just as easily call wait on the future in a thread (or strand?)) and then call the handler when completed?)

As it stands right now, it makes client code all that much more complex if you want to implement true async, non-blocking or non-polling code.

I've tried to implement my own service in ASIO to do this, but alas, the ASIO code is above my C++ ability, and cpp-netlib is even more complex :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions