spinframework / spinframework/spin

Docs Question: Making a trigger plugin

Open
#2,468 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.