ThingWorx WebSocket-based Edge MicroServer (WS EMS) and Lua Script Resource (LSR) > Configuring a Template for the Lua Script Resource > Configuring Tasks
Configuring Tasks
Use the task group to define Lua functions that are executed periodically by the Lua Script Resource (LSR), such as background tasks, resource monitoring, event firing, and so on. These tasks allow you to introduce any customized functionality that you may need. You should follow the general pattern shown in the sample below:
tasks.Compare = function(me)
-- Do task
The following table lists and describes the parameters that you can use to configure tasks:
Implement a task that is scheduled in the Lua Script Resource to run periodically.
Create a table that refers to the thing.
Define the end of the Lua function that defines the task.