wrench::FunctionManager
-
class FunctionManager : public wrench::Service
A manager for interacting with a serverless compute service.
Public Functions
Invokes a function on a ServerlessComputeService.
- Parameters:
_function – the function to invoke
sl_compute_service – the ServerlessComputeService to invoke the function on
function_input – the input (object) to the function
- Returns:
std::shared_ptr<Invocation> an Invocation object created by the ServerlessComputeService
State finding method to check if an invocation is done.
- Parameters:
invocation – the invocation to check
- Returns:
true if the invocation is done
- Returns:
false if the invocation is not done
-
void kill()
Kill the function manager.
Registers a function with the ServerlessComputeService.
- Parameters:
name – the function’s name
initialization_code – the function’s initialization code, which is executed only once on each container for the function, before any actual function executions can take place.
code – the function’s code, which can only be executed after the initialization code has executed (successfully) on the container. Note that if this function creates files on the container’s storage, these files will remain and will be seen by subsequent function executions on that container. A function may thus want to clean up after itself.
image – the function’s image
sl_compute_service – the ServerlessComputeService to register the function on
time_limit_in_seconds – the time limit for the function execution
disk_space_limit_in_bytes – the disk space limit for the function
RAM_limit_in_bytes – the RAM limit for the function
ingress_in_bytes – the ingress data limit (this is currently completely IGNORED)
egress_in_bytes – the egress data limit (this is currently completely IGNORED)
- Throws:
ExecutionException – if the function registration fails
- Returns:
true if the function was registered successfully
-
virtual void stop() override
Stop the manager.
Waits for a list of invocations to finish.
- Parameters:
invocations – the invocations to wait for
Waits for a single invocation to finish.
- Parameters:
invocation – the invocation to wait for
Public Static Functions
create an image
- Parameters:
name – a name
layers – The layers that comprise the image
- Returns:
- Parameters:
name –
parent_image – The parent image
additional_layers – The additional layers that make up the image
- Returns:
Create an image layer.
- Parameters:
name – a name
location – the location of the image layer file
ram_foot_print – the RAM footprint of the image layer
- Returns:
An image layer