Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
CurlFetchThread Class Reference
+ Inheritance diagram for CurlFetchThread:
+ Collaboration diagram for CurlFetchThread:

Classes

struct  Request
 

Public Member Functions

 CurlFetchThread (int parallel_limit)
 
void requestFetch (const HTTPFetchRequest &fetch_request)
 
void requestClear (u64 caller, Event *event)
 
void requestWakeUp ()
 
- Public Member Functions inherited from Thread
 Thread (const std::string &name="")
 
virtual ~Thread ()
 
bool start ()
 
bool stop ()
 
bool wait ()
 
bool isCurrentThread ()
 
bool isRunning ()
 
bool stopRequested ()
 
std::thread::id getThreadId ()
 
bool getReturnValue (void **ret)
 
bool bindToProcessor (unsigned int proc_number)
 
bool setPriority (int prio)
 

Protected Types

enum  RequestType { RT_FETCH , RT_CLEAR , RT_WAKEUP }
 

Protected Member Functions

void processRequest (Request &req)
 
void processQueued (CurlHandlePool *pool)
 
void processCurlMessage (CURLMsg *msg)
 
void waitForRequest (long timeout)
 
void waitForIO (long timeout)
 
void * run ()
 

Protected Attributes

CURLM * m_multi
 
MutexedQueue< Requestm_requests
 
size_t m_parallel_limit
 
std::vector< std::unique_ptr< HTTPFetchOngoing > > m_all_ongoing
 
std::list< HTTPFetchRequestm_queued_fetches
 
- Protected Attributes inherited from Thread
std::string m_name
 

Additional Inherited Members

- Static Public Member Functions inherited from Thread
static ThreadgetCurrentThread ()
 
static void setName (const std::string &name)
 
static unsigned int getNumberOfProcessors ()
 

Member Enumeration Documentation

◆ RequestType

Enumerator
RT_FETCH 
RT_CLEAR 
RT_WAKEUP 

Constructor & Destructor Documentation

◆ CurlFetchThread()

CurlFetchThread::CurlFetchThread ( int parallel_limit)
inline

References m_parallel_limit.

Member Function Documentation

◆ processCurlMessage()

void CurlFetchThread::processCurlMessage ( CURLMsg * msg)
inlineprotected

References httpfetch_deliver_result(), and m_all_ongoing.

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processQueued()

void CurlFetchThread::processQueued ( CurlHandlePool * pool)
inlineprotected

References httpfetch_deliver_result(), m_all_ongoing, m_multi, m_parallel_limit, and m_queued_fetches.

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processRequest()

void CurlFetchThread::processRequest ( Request & req)
inlineprotected

References HTTPFetchRequest::caller, CurlFetchThread::Request::event, CurlFetchThread::Request::fetch_request, m_all_ongoing, m_queued_fetches, RT_CLEAR, RT_FETCH, RT_WAKEUP, Event::signal(), and CurlFetchThread::Request::type.

Referenced by run(), and waitForRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requestClear()

◆ requestFetch()

void CurlFetchThread::requestFetch ( const HTTPFetchRequest & fetch_request)
inline

◆ requestWakeUp()

void CurlFetchThread::requestWakeUp ( )
inline

◆ run()

void * CurlFetchThread::run ( )
inlineprotectedvirtual

Implements Thread.

References BEGIN_DEBUG_EXCEPTION_HANDLER, END_DEBUG_EXCEPTION_HANDLER, errorstream, FATAL_ERROR_IF, m_all_ongoing, m_multi, m_queued_fetches, m_requests, processCurlMessage(), processQueued(), processRequest(), Thread::stopRequested(), waitForIO(), and waitForRequest().

+ Here is the call graph for this function:

◆ waitForIO()

void CurlFetchThread::waitForIO ( long timeout)
inlineprotected

References errorstream, m_multi, and sleep_ms.

Referenced by run().

+ Here is the caller graph for this function:

◆ waitForRequest()

void CurlFetchThread::waitForRequest ( long timeout)
inlineprotected

References m_queued_fetches, m_requests, and processRequest().

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_all_ongoing

std::vector<std::unique_ptr<HTTPFetchOngoing> > CurlFetchThread::m_all_ongoing
protected

◆ m_multi

CURLM* CurlFetchThread::m_multi
protected

Referenced by processQueued(), run(), and waitForIO().

◆ m_parallel_limit

size_t CurlFetchThread::m_parallel_limit
protected

Referenced by CurlFetchThread(), and processQueued().

◆ m_queued_fetches

std::list<HTTPFetchRequest> CurlFetchThread::m_queued_fetches
protected

◆ m_requests

MutexedQueue<Request> CurlFetchThread::m_requests
protected

The documentation for this class was generated from the following file: