Skip to content

ACurlMulti#

Multi curl instance.

Header:#include <AUI/Curl/ACurlMulti.h>
CMake:aui_link(my_target PUBLIC aui::curl)

Detailed Description#

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(); m << _new(...); AUI_ASSERT(!m->empty()); // assertion failure here

Use AThread::processMessages() function to avoid this limitation:

auto m = _new(); m << _new(...); AThread::processMessages() // + AUI_ASSERT(!m->empty()); // ok!

Public Methods#

global#


static ACurlMulti& ACurlMulti::global()

Global instance of ACurlMulti, running in a separate thread.

Examples#

examples/app/game_of_life/src/main.cpp

Game of Life - Game of Life implementation that uses advanced large dynamic data rendering techniques such as ITexture, AImage to be GPU friendly. The computation is performed in AThreadPool.

        connect(isRunning.changed, AUI_SLOT(mTimer)::setRunning);
    }

    void frame() {
        mFrame = AThreadPool::global() * [&] {
            for (int y = 0; y < mSize.y; ++y) {
                for (int x = 0; x < mSize.x; ++x) {
                    glm::ivec2 i { x, y };
                    get(mNextPopulation, i) = [&] {
                        auto around = cellsAround(i);
examples/app/minesweeper/src/Style.cpp

Minesweeper Game - Minesweeper game implementation driven by ass.

struct GlobalStyle {
    GlobalStyle() {
        AStylesheet::global().addRules({
          {
            t<CellView>(),
            FixedSize { 26_dp },
            BackgroundSolid { 0xdedede_rgb },
            Border { 1_px, 0xeaeaea_rgb },