faastjs > CommonOptions > mode
Specify invocation mode. Default:
mode?: "https" | "queue" | "auto";
Modes specify how invocations are triggered. In https mode, the functions are invoked through an https request or the provider's API. In queue mode, a provider-specific queue is used to invoke functions. Queue mode adds additional latency and (usually negligible) cost, but may scale better for some providers. In auto mode the best default is chosen for each provider depending on its particular performance characteristics.
The defaults are:
"https". In https mode, the AWS SDK api is used to invoke functions. In queue mode, an AWS SNS topic is created and triggers invocations. The AWS API Gateway service is never used by faast, as it incurs a higher cost and is not needed to trigger invocations.
"https". In https mode, a PUT request is made to invoke the cloud function. In queue mode, a PubSub topic is created to invoke functions.
local: The local provider ignores the mode setting and always uses an internal asynchronous queue to schedule calls.
Size limits are affected by the choice of mode. On AWS the limit is 256kb for arguments and return values in
"queue" mode, and 6MB for
"https" mode. For Google the limit is 10MB regardless of mode. In Local mode messages are sent via node's IPC and are subject to OS IPC limits.
Note that no matter which mode is selected, faast.js always creates a queue for sending back intermediate results for bookeeping and performance monitoring.