Cleanup async client APIs.

This commit is contained in:
Chunting Gu
2019-03-07 16:02:49 +08:00
parent ffa0794926
commit 31d0ea3c9d
74 changed files with 267 additions and 2106 deletions
+6 -6
View File
@@ -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_;