Function async_stage

Synopsis

#include <include/flecs/addons/cpp/world.hpp>

flecs::world async_stage() const

Description

Create asynchronous stage. An asynchronous stage can be used to asynchronously queue operations for later merging with the world. An asynchronous stage is similar to a regular stage, except that it does not allow reading from the world.

Asynchronous stages are never merged automatically, and must therefore be manually merged with the ecs_merge function. It is not necessary to call defer_begin or defer_end before and after enqueuing commands, as an asynchronous stage unconditionally defers operations.

The application must ensure that no commands are added to the stage while the stage is being merged.

An asynchronous stage must be cleaned up by ecs_async_stage_free.

Returns
The stage.

Source

Lines 402-406 in include/flecs/addons/cpp/world.hpp.

flecs::world async_stage() const {
    auto result = flecs::world(ecs_async_stage_new(m_world));
    result.m_owned = true;
    return result;
}