Cleanup async client APIs.
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class BookListService : public webcc::RestListService {
|
||||
public:
|
||||
public:
|
||||
explicit BookListService(int sleep_seconds)
|
||||
: sleep_seconds_(sleep_seconds) {
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
// Get a list of books based on query parameters.
|
||||
void Get(const webcc::UrlQuery& query, webcc::RestResponse* response) final;
|
||||
|
||||
@@ -22,7 +22,7 @@ class BookListService : public webcc::RestListService {
|
||||
void Post(const std::string& request_content,
|
||||
webcc::RestResponse* response) final;
|
||||
|
||||
private:
|
||||
private:
|
||||
// Sleep some seconds before send back the response.
|
||||
// For testing timeout control in client side.
|
||||
int sleep_seconds_;
|
||||
@@ -33,12 +33,12 @@ class BookListService : public webcc::RestListService {
|
||||
// The URL is like '/books/{BookID}', and the 'url_sub_matches' parameter
|
||||
// contains the matched book ID.
|
||||
class BookDetailService : public webcc::RestDetailService {
|
||||
public:
|
||||
public:
|
||||
explicit BookDetailService(int sleep_seconds)
|
||||
: sleep_seconds_(sleep_seconds) {
|
||||
}
|
||||
|
||||
protected:
|
||||
public:
|
||||
// Get the detailed information of a book.
|
||||
void Get(const webcc::UrlSubMatches& url_sub_matches,
|
||||
const webcc::UrlQuery& query,
|
||||
@@ -53,7 +53,7 @@ class BookDetailService : public webcc::RestDetailService {
|
||||
void Delete(const webcc::UrlSubMatches& url_sub_matches,
|
||||
webcc::RestResponse* response) final;
|
||||
|
||||
private:
|
||||
private:
|
||||
// Sleep some seconds before send back the response.
|
||||
// For testing timeout control in client side.
|
||||
int sleep_seconds_;
|
||||
|
||||
Reference in New Issue
Block a user