wrench::Function

class Function

Represents a serverless function, encapsulating its metadata and behavior.

Public Functions

Function(const std::string &name, const std::function<std::shared_ptr<FunctionOutput>(const std::shared_ptr<FunctionInput>&, const std::shared_ptr<StorageService>&)> &code, const std::shared_ptr<Image> &image, double time_limit_in_seconds, sg_size_t disk_space_limit_in_bytes, sg_size_t RAM_limit_in_bytes, sg_size_t ingress_in_bytes, sg_size_t egress_in_bytes)

Constructor.

Parameters:
  • name – The function’s name.

  • code – the function’s code.

  • image – the function’s image.

  • 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 for the function.

  • egress_in_bytes – The egress data limit for the function.

sg_size_t getDiskSpaceLimit() const

Get the function’s disk space limit.

Returns:

A RAN limit in bytes

std::shared_ptr<Image> getImage() const

Get the function’s image.

Returns:

A file

std::string getName() const

Get the function’s name.

Returns:

A name

sg_size_t getRAMSpaceLimit() const

Get the function’s RAM limit.

Returns:

A RAN limit in bytes

double getTimeLimit() const

Get the function’s time limit.

Returns:

A time limit in seconds