docs/content/sips/003-trigger-executors.md
Summary: A new architecture for Spin trigger executors.
Owner: [email protected]
Created: April 29, 2022
Updated: May 5, 2022
Spin currently includes built-in implementations for two trigger types: HTTP, and Redis (PubSub). We want to allow for additional trigger types in the future, whether they are "internal" types developed and supported within the Spin codebase, or "external" types developed by the broader community.
While it is currently possible to build external trigger types - as in the
TimerTrigger example - it requires replicating much of the
functionality provided by the spin up command.
These executors are regular subcommands/binaries, but are not normally executed directly by users.
spin subcommands, e.g. spin trigger httpspin-trigger-timerspin-trigger cratespin up command changesIt remains the primary entrypoint for starting a Spin app, but its behavior is changed to:
PATH for "spin-trigger-${trigger.type}")SPIN_MANIFEST_URL: a URL pointing to the application manifest (e.g. file:///path/to/spin.toml or bindle+https://bindle-server?id=bindle-id)SPIN_TRIGGER_TYPE the spin trigger type (e.g. http) being executedexec the trigger executor, forwarding its own CLI argumentsThis section contains possible future features which are not fully defined here.
If multiple trigger types were to be supported by a single application, the role of spin up could
grow to include trigger orchestration:
If the "Multi-trigger orchestration" option is taken, having separate processes for different triggers might have some disadvantages: