Skip to content

Commit

Permalink
update wasm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cohix committed Sep 3, 2021
1 parent 71a5fce commit af4578b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions docs/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Reactr has first-class support for WebAssembly-packaged Runnables. Wasm is an incredibly useful modern portable binary format that allows multiple languages to be compiled into .wasm modules.

Wasm support in Reactr is powered by [Wasmer](https://github.com/wasmerio/wasmer-go), the hard work they've done to create a powerful and extensible Wasm runtime has been very much appreciated, and it's been very cool seeing that project grow.

The current supported languages are Rust (stable), TypeScript/AssemblyScript (beta) and Swift (alpha). The Runnable API is available for each. More languages such as Go and C++ are coming soon!

To create a Wasm runnable, check out the [subo CLI](https://github.com/suborbital/subo). Once you've generated a `.wasm` file, you can use it with Reactr just like any other Runnable!
Expand All @@ -30,18 +28,4 @@ if err != nil {
fmt.Println(string(res.([]byte)))
```

## Bundles
If you use `subo` to create a [bundle](https://github.com/suborbital/subo/blob/main/docs/get-started.md#bundles), you can load the entire bundle with all of its runnables into your Reactr instance:
```golang
if err := bundle.Load(r, "path/to/runnables.wasm.zip"); err != nil {
//handle failure
}

res := r.Do(rt.NewJob("name_of_runnable", "input_will_be_converted_to_bytes"))
[...]
```
The name of each runnable is defined in the `.runnable.yaml` file it was built with.

And that's it! You can schedule Wasm jobs as normal, and Wasm environments will be managed automatically to run your jobs.

Please file issues if you encounter anything, and please give the Wasmer team a shout-out for all the great work!
And that's it! You can schedule Wasm jobs as normal, and Wasm environments will be managed automatically to run your jobs.

0 comments on commit af4578b

Please sign in to comment.