spinframework / spinframework/spin
Docs Question: Making a trigger plugin
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
First of all, I have used WASM for some time and wanted to explore the potential of WASI when I found this project. Great stuff! Nice design and it really shows how to make some WASI-first architecture and re-design how we think of components and services. I am very inspired by the architecture.
I am looking to make a custom task manager, which could be grafted onto HTTP somehow I guess, but I would really love to make a custom trigger type for my project to make that work. I looked into the code and see how you can add triggers via plugins and also see this approach discussed in an issue.
I'd really like to understand how one could add such a plugin. The plugin documentation references one example: spin-timer. This is a huge step forward, and I can see how to implement the run of TriggerExecutor. However, it also raises a number of questions, especially around the macros (wasmtime::component::bindgen and wit_bindgen::generate), the *.wit files themselves, and this Guest implementation.
If there is any more documentation internally (or in wasmtime) that would help explain this, I would greatly appreciate a link. If not, it would be awesome if there was some more in the spin-timer example - either inline comments or in the README.
Thank you again for the project and I look forward to building on it
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the plugin-authoring documentation, src/commands/up.rs, and the examples/spin-timer README and app-example/src/lib.rs referenced in the issue. Document how the wasmtime::component::bindgen and wit_bindgen::generate macros, *.wit files, and Guest implementation fit together, with the added explanation placed in the README or inline comments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100