mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Tidy up AbstractHandler usage in HTTPClient
This commit is contained in:
@@ -68,7 +68,7 @@ public:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void abstract_async_get (boost::asio::io_service& io_service, URL const& url,
|
void async_get (boost::asio::io_service& io_service, URL const& url,
|
||||||
AbstractHandler <void (result_type)> handler)
|
AbstractHandler <void (result_type)> handler)
|
||||||
{
|
{
|
||||||
new Session (*this, io_service, url,
|
new Session (*this, io_service, url,
|
||||||
|
|||||||
@@ -45,15 +45,20 @@ public:
|
|||||||
|
|
||||||
virtual result_type get (URL const& url) = 0;
|
virtual result_type get (URL const& url) = 0;
|
||||||
|
|
||||||
template <typename GetHandler>
|
/** Perform an asynchronous get on the specified URL.
|
||||||
|
Handler will be called with this signature:
|
||||||
|
void (result_type)
|
||||||
|
*/
|
||||||
|
template <typename Handler>
|
||||||
void async_get (boost::asio::io_service& io_service,
|
void async_get (boost::asio::io_service& io_service,
|
||||||
URL const& url, GetHandler handler)
|
URL const& url, BEAST_MOVE_ARG(Handler) handler)
|
||||||
{
|
{
|
||||||
abstract_async_get (io_service, url,
|
async_get (io_service, url,
|
||||||
AbstractHandler <void (result_type)> (handler));
|
AbstractHandler <void (result_type)> (
|
||||||
|
BEAST_MOVE_CAST(Handler)(handler)));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void abstract_async_get (boost::asio::io_service& io_service,
|
virtual void async_get (boost::asio::io_service& io_service,
|
||||||
URL const& url, AbstractHandler <void (result_type)> handler) = 0;
|
URL const& url, AbstractHandler <void (result_type)> handler) = 0;
|
||||||
|
|
||||||
/** Cancel all pending asynchronous operations. */
|
/** Cancel all pending asynchronous operations. */
|
||||||
|
|||||||
Reference in New Issue
Block a user