LUA_FUNCTION_DEF (worker, get_name);
LUA_FUNCTION_DEF (worker, get_stat);
LUA_FUNCTION_DEF (worker, get_index);
+LUA_FUNCTION_DEF (worker, get_count);
LUA_FUNCTION_DEF (worker, get_pid);
LUA_FUNCTION_DEF (worker, is_scanner);
LUA_FUNCTION_DEF (worker, is_primary_controller);
LUA_INTERFACE_DEF (worker, get_name),
LUA_INTERFACE_DEF (worker, get_stat),
LUA_INTERFACE_DEF (worker, get_index),
+ LUA_INTERFACE_DEF (worker, get_count),
LUA_INTERFACE_DEF (worker, get_pid),
LUA_INTERFACE_DEF (worker, spawn_process),
LUA_INTERFACE_DEF (worker, is_scanner),
return 1;
}
+static gint
+lua_worker_get_count (lua_State *L)
+{
+ struct rspamd_worker *w = lua_check_worker (L, 1);
+
+ if (w) {
+ lua_pushinteger (L, w->cf->count);
+ }
+ else {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ return 1;
+}
+
static gint
lua_worker_get_pid (lua_State *L)
{