util.resource.is_running

Shared

Checks whether a resource is currently running


Syntax

local result = util.resource.is_running(
    name
)

Parameters

TypeNameDescription
stringnameName of the resource to check

Returns

TypeNameDescription
boolresulttrue if the resource is currently running, false otherwise

Examples

Check if a resource is running
if util.resource.is_running("my_resource") then
    core.engine.print("info", "Resource is running")
end
Guard an export call based on running state
if not util.resource.is_running("inventory_resource") then
    core.engine.print("warn", "inventory_resource is not running")
    return
end

local items = util.export.call("inventory_resource", "get_items")
core.engine.iprint(items)

On this page