← 输入框|github.com|刷新
Skip to content

Completion Handler for Async Downloads? #53

Closed

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 :)

Activity

  1. Fishwaldo commented on Jun 13, 2011

    @Fishwaldo
    Author

    Awesome.

    Question, will this be implemented on the 0.9-devel branch, or the 1.0-devel branch. I'd like to track the development it if at all possible.

  2. ghost closed this as completedin c78ca0don Jun 16, 2011
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions