Synchronized workflows for WASM WebWorkers

10 views
Skip to first unread message

Tobias Cudnik

unread,
5:41 AM (7 hours ago) 5:41 AM
to golang-nuts
Hello, I wanted to share a stateful workflow engine with the group.
Ive prepared a demo spanning across 4 nodes running in WASM
WebWorkers, with an external Linux orchestrator. They compute a Merkle
DAG with slow hashing while random errors occur (either corruption or
failures); the orchestrator then recovers from these errors. The
topology is a mix of star and tree (every client can also be a server)
with a TCP relay for browsers.

The easiest way to explore the demo is through OTel traces [0] [1],
and there’s also a dedicated TUI debugger with diagrams. Also a REPL
which can change the state of each node live with completion.

This work was inspired by the recent wasm.io. These workflows are a
form of structured concurrency and you can load the recorded debug
session using `go run` for inspection. The source code and a longer
write-up with diagrams are on the website [2] and GitHub [3].

[0] https://assets.asyncmachine.dev/examples/wasm-workflow-traces.png
[1] https://asyncmachine.dev/demo-traces/trace/daaa1f7fb9bab9e5e0dfc6beb56a4a82
[2] https://asyncmachine.dev/wasm-workflow
[3] https://github.com/pancsta/asyncmachine-go/tree/main/examples/wasm_workflow

Enjoy and AMA,

--
Tobias Cudnik
tobias @ blogic.tech
Reply all
Reply to author
Forward
0 new messages