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>
This commit is contained in:
19
src/script/lua_api/l_async.h
Normal file
19
src/script/lua_api/l_async.h
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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);
|
||||
};
|
||||
Reference in New Issue
Block a user