Mayfly – an AWS Lambda custom runtime for Elixir.
Nothing starts automatically. Inside Lambda the generated bootstrap runs
Mayfly.Boot.main/0, which reads the environment and calls start_link/1.
You can also start the runtime yourself (for example from your own
supervision tree when using Mayfly.LocalRuntime in tests):
Mayfly.start_link(handler: "MyApp.Handler", runtime_api: "127.0.0.1:9001")Options
:handler–_HANDLERstring (module orModule.function); defaultSystem.get_env("_HANDLER"):runtime_api–host:port; defaultSystem.get_env("AWS_LAMBDA_RUNTIME_API"):concurrency– number of pollers; defaultAWS_LAMBDA_MAX_CONCURRENCYor 1:handler_opts– passed to the handler'sinit/1; default[]:extension– register the internal Lambda extension (Mayfly.Extension: platform telemetry as:telemetryevents); defaultMAYFLY_EXTENSION=1orconfig :mayfly, extension: true, else off:extension_opts– passed toMayfly.Extension(tests use it):name– supervisor name;nilfor an unnamed supervisor (defaultMayfly.Supervisor):api– module implementingMayfly.RuntimeAPI(tests)
Summary
Functions
Resolves and initialises the handler, then starts the poller supervisor.
Functions
@spec start_link(keyword()) :: Supervisor.on_start() | {:error, {:init_error, Mayfly.ErrorPayload.t()}}
Resolves and initialises the handler, then starts the poller supervisor.
Returns {:error, {:init_error, payload}} when the handler cannot be
resolved or its init/1 fails; the payload has already been posted to
/runtime/init/error at that point.