AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Multi curl instance. More...
Multi curl instance.
Provides support to multiple simultaneous curl requests in a one thread.
Analogous to Qt's QNetworkAccessManager.
All calls are processed by enqueueing them on ACurlMulti's thread, so the underlying curl handle is used by the single thread. This means that the following code will fail:
auto m = _new<ACurlMulti>(); m << _new<ACurl>(...); AUI_ASSERT(!m->empty()); // assertion failure here
Use AThread::processMessages() function to avoid this limitation:
auto m = _new<ACurlMulti>(); m << _new<ACurl>(...); AThread::processMessages() // + AUI_ASSERT(!m->empty()); // ok!
Public Member Functions | |
ACurlMulti (ACurlMulti &&other) noexcept | |
ACurlMulti & | operator<< (_< ACurl > curl) |
ACurlMulti & | operator>> (const _< ACurl > &curl) |
void | run () |
void | cancel () |
void | clear () |
const AMap< void *, _< ACurl > > & | curls () const |
Public Member Functions inherited from AObject | |
_< AObject > | sharedPtr () |
_weak< AObject > | weakPtr () |
void | clearSignals () noexcept |
template<AAnySignal Signal, ACompatibleSlotFor< Signal > Function> | |
void | connect (Signal &signal, Function &&function) |
void | setSignalsEnabled (bool enabled) |
bool | isSignalsEnabled () const noexcept |
template<ASignalInvokable T> | |
void | operator^ (T &&t) |
_< AAbstractThread > | getThread () const |
bool | isSlotsCallsOnlyOnMyThread () const noexcept |
void | setSlotsCallsOnlyOnMyThread (bool slotsCallsOnlyOnMyThread) |
Public Member Functions inherited from aui::noncopyable | |
noncopyable (const noncopyable &)=delete | |
noncopyable & | operator= (const noncopyable &)=delete |
Static Public Member Functions | |
static ACurlMulti & | global () noexcept |
Global instance of ACurlMulti, running in a separate thread. | |
Static Public Member Functions inherited from AObject | |
static void | disconnect () |
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function> | |
static void | connect (Signal &signal, Object *object, Function &&function) |
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function> | |
static void | connect (Signal &signal, Object &object, Function &&function) |
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function> | |
static void | connect (Signal &signal, _< Object > object, Function &&function) |
static void | moveToThread (aui::no_escape< AObject > object, _< AAbstractThread > thread) |
Additional Inherited Members | |
Protected Member Functions inherited from AObject | |
void | setThread (_< AAbstractThread > thread) |
Set thread of the object. | |
#include <AUI/Curl/ACurlMulti.h>