Functions
Last updated
Last updated
A Task represents a planned or scheduled piece of code. The code definition is a Function in Extra Horizon.
Developers can leverage the power of the Extra Horizon CLI to efficiently create new Functions and seamlessly update existing ones, this can be achieved by using the exh tasks sync
command.
See the Extra Horizon CLI documentation for more information.
A step-by-step guide on how to deploy a Function is available in the hello world example.
The may be used within a Function to easily interface with Extra Horizon services.
See the Extra Horizon CLI documentation for more information.
In order to Delete a Task Function, you will need as a User to have the DELETE_TASK_FUNCTION permission.
See the Extra Horizon CLI documentation for more information.
If a function is removed from the task service its executions (tasks) and the logs aren't removed and can still be retrieved
The name
property serves as the unique identifier amongst all Functions.
The description
property may be supplied to provide a brief explanation regarding a Function's purpose.
The entryPoint
property refers to the method in the Function code that is executed.
The runtime
property selects the runtime (or environment) the Function will be running in. The Task Service utilizes AWS Lambda to run Functions. Any runtime supported by AWS Lambda is supported by the Task Service.
See the AWS Lambda documentation for a list of supported runtimes: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
The timeLimit
represents the maximum allowed execution time limit for this Function in seconds. This value may have a minimum value of 3
seconds and a maximum value of 300
seconds.
The memoryLimit
allocates the desired memory for a Function's execution in MB. This value may have a minimum value of 128
MB and a maximum value of 10240
MB.
The environmentVariables
represent the environment variables in the Function execution runtime.
The following code snippet shows an example how to configure the environment variables:
Available since v1.3.0
The retryPolicy
field can be used to determine system behavior after the execution of a Function (Task) fails.
The following code snippet shows an example how to configure the retry policy:
enabled
The retry policy is disabled by default, If this field is set to true
, the retry policy becomes active. If active the policy will retry a maximum of 3 times, with an increasing timeout of 2, 5 and 10 seconds respectively.
errorsToRetry
It is possible to restrict the retry policy to a specific set of errors using this property.
The executionOptions
field may be used to configure how the function can be executed.
The following code snippet shows an example how to configure the execution options:
permissionMode
This property determines execution restrictions based on its assigned value. One of the following values may be assigned to the permissionMode
property to enforce execution restrictions.
The permissionMode is only considered for direct execution of a Function or API Functions.
permissionMode | Description |
---|---|
| A user requires a permission as stated for the API Function permissions section. This is the default permission mode. |
| A user must be logged in, but no permission is required. |
| Any party may execute this function without any restrictions. |
For information regarding the application of permissions to users please refer to global roles.