/examples/README.md
- Examples
- aRPC
- Basic
- CLI
- CLI Daemon
- Mach Template
- Tree State Source
- TUI
- WASM
- WASM Workflow
- DAG Dependency Graph
- Fan Out Fan In
- FSM - Finite State Machine
- NFA - Nondeterministic Finite Automaton
- PATH Watcher
- Pipes
- Raw Strings
- Relations Playground
- REPL
- Subscriptions
- Temporal Expense Workflow
- Temporal FileProcessing Workflow
- Benchmarks
- Demos
- Apps
Examples
Headers link to actual examples.
aRPC
aRPC client and server example.
#rpc #client #server #template- origin
Basic
Very basic, yet modern example of asyncmachine-go.
#relations #handlers #async #negotiation #auto
CLI
go-arg based CLI example.
#template #relations #handlers #template
CLI Daemon
go-arg based CLI with an aRPC daemon example.
#template #relations #handlers #arpc #payload #template
Mach Template
Copy-paste boilerplate to set up a new machine.
#template #handlers #telemetry #repl #relations #generator #negotiation #multi #template
Tree State Source
Single writer distributed to multiple readers in a tree structure.
#relations #negotiation #auto #arpc #otel #metrics #grafana #generator #data- origin
TUI
cview based TUI app example.
#relations #handlers #cview #ui #global-handlers
WASM
aRPC WASM architecture with a simple chat.
#relations #handlers #arpc-handlers #arpc #relay #ui #websocket
WASM Workflow
WebWorker WASM workflow example.
#relations #handlers #arpc-handlers #arpc #relay #websocket #webworkers #payload
DAG Dependency Graph
Sync and async DAG / dependency graph example.
#relations #handlers #async #auto #dependency-graph
Fan Out Fan In
Distributing work to multiple worker states and collecting the results.
#relations #handlers #async #auto #concurrency
FSM - Finite State Machine
Classic FSM example.
#relations #handlers #negotiation #auto- origin
NFA - Nondeterministic Finite Automaton
Classic NFA example.
#relations #handlers #async #multi- origin
PATH Watcher
Watch file system paths for changes.
#relations #handlers #async #negotiation #multi- origin
Pipes
How to pipe states between state machines.
#handlers #composition- origin
Raw Strings
Very basic and old school example of asyncmachine-go.
#relations #handlers #async #negotiation #auto- origin
Relations Playground
Code from the relations playground.
#relations- origin
REPL
REPL boilerplate.
#arpc #repl #template- origin
Subscriptions
Very basic example of waiting for states.
#waiting- origin
Temporal Expense Workflow
Workflow ported from Temporal.
#relations #handlers #async #negotiation #auto #temporal- origin
Temporal FileProcessing Workflow
Workflow ported from Temporal.
#relations #handlers #async #auto #temporal- origin
- Asynq worker version
Benchmarks
Benchmark State Source
Benchmark adding tree nodes to the state source example.
#docker #go-wrt #caddy- origin
Benchmark gRPC
Benchmark aRPC vs gRPC.
#relations #handlers #negotiation #arpc #grpc- origin
Benchmark libp2p PubSub
Very old benchmark of libp2p pubsub ported to asyncmachine-go.
#relations #handlers #async #negotiation #libp2p
Demos
am-dbg Debugger
Interactively use the TUI debugger with data pre-generated by a secai bot:
go run github.com/pancsta/asyncmachine-go/tools/cmd/am-dbg@latest \
--import-data https://pancsta.github.io/assets/asyncmachine-go/am-dbg-exports/secai-cook.gob.br \
mach://cook
Apps
asyncmachine-go synchronizes state for the following projects:
- secai - AI Workflows framework
- secai Web UI - WebAssembly go-app PWA
- Self-hosting of pkg/rpc, pkg/node, pkg/pubsub
- arpc REPL - Cobra-based REPL
- am-dbg TUI Debugger - Single state-machine TUI app
- libp2p PubSub Simulator - Sandbox simulator for libp2p-pubsub
- libp2p PubSub Benchmark - Benchmark of libp2p-pubsub ported to asyncmachine-go
monorepo
Go back to the monorepo root to continue reading.
