|
Twitch SDK (Internal)
|
#include <httprequestutils.h>
Public Types | |
| typedef std::function< TTV_ErrorCode(const std::string &cursor, std::shared_ptr< Task > &task)> | CreateTaskCallback |
| typedef std::function< void(TTV_ErrorCode ec)> | CompleteCallback |
Public Member Functions | |
| PagedRequestFetcher () | |
| TTV_ErrorCode | Start (const std::string &initialCursor, CreateTaskCallback createTaskCallback, CompleteCallback completeCallback) |
| void | Cancel () |
| void | FetchComplete (TTV_ErrorCode ec, const std::string &cursor) |
| bool | InProgress () const |
Protected Member Functions | |
| TTV_ErrorCode | FetchPage () |
Protected Attributes | |
| CreateTaskCallback | mCreateTaskCallback |
| CompleteCallback | mCompleteCallback |
| std::shared_ptr< Task > | mCurrentTask |
| std::string | mCursor |
| bool | mCancel |
A helper class that fetches all pages of an endpoint. It is assumed that only status codes in the range [200, 299] will be returned when a successful page is returned.
| typedef std::function<void(TTV_ErrorCode ec)> ttv::PagedRequestFetcher::CompleteCallback |
Called when page fetching is complete.
| typedef std::function<TTV_ErrorCode(const std::string& cursor, std::shared_ptr<Task>& task)> ttv::PagedRequestFetcher::CreateTaskCallback |
Called by the fetcher to create and schedule the next task with a task runner.
| ttv::PagedRequestFetcher::PagedRequestFetcher | ( | ) |
| void ttv::PagedRequestFetcher::Cancel | ( | ) |
Cancels the fetching of further pages.
| void ttv::PagedRequestFetcher::FetchComplete | ( | TTV_ErrorCode | ec, |
| const std::string & | cursor | ||
| ) |
Called by the client to notify the fetcher that the fetch of the current page has completed.
|
protected |
|
inline |
Whether or not fetches are in progress.
| TTV_ErrorCode ttv::PagedRequestFetcher::Start | ( | const std::string & | initialCursor, |
| CreateTaskCallback | createTaskCallback, | ||
| CompleteCallback | completeCallback | ||
| ) |
Kicks off the fetching of pages.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.13