Files
luanti/src/script/lua_api/l_async.h
y5nw f390137d6e Add API to cancel async jobs (#14602)
* Implement API to cancel async jobs

Co-authored-by: sfan5 <sfan5@live.de>

* update AsyncJob:cancel documentation from review

* Use IPC to unblock async

* review

* review async unblocking

* review

* Apply suggestions from code review

Co-authored-by: sfan5 <sfan5@live.de>

* minor licensing

---------

Co-authored-by: y5nw <y5nw@protonmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2025-08-26 12:40:31 +02:00

20 lines
477 B
C++

// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
#pragma once
#include "lua_api/l_base.h"
class ModApiAsync : public ModApiBase
{
public:
static void Initialize(lua_State *L, int top);
private:
// do_async_callback(func, params, mod_origin)
static int l_do_async_callback(lua_State *L);
// cancel_async_callback(id)
static int l_cancel_async_callback(lua_State *L);
// get_async_threading_capacity()
static int l_get_async_threading_capacity(lua_State *L);
};