Functions

An overview of Functions

Functions are units of execution in the AssemblyLift framework. They are grouped into services, and are themselves structured according to the chosen language (e.g with Rust each function is a Cargo crate).

Each function is compiled to a WebAssembly module, compatible with the AssemblyLift ABI.

Overview

An AssemblyLift Function is an executable containing a handler, which is the entrypoint of the Function (similar to a main method in a regular application). A Function usually receives some input which is passed to the handler as an argument; the shape of this input will depend on the Function. The Function should return by indicating either success or an error to the runtime, though the Function is not required to return any specific data.

Functions which are invoked by an HTTP API for example, will receive input data in the shape of an API Gateway Event (assuming you are using the default AWS provider).

The input payload received by a Function must be represented as JSON.

Make a New Function

You can create a new function in an existing service with the make command:

$ asml make function myservice.myfunction

where myservice is the name of the service in which you would like to make the function named myfunction.

Last updated