Skip to content

Commit

Permalink
chore: update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta committed Feb 25, 2025
1 parent dd8496d commit dee8e24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ if err != nil {
```

<div align="center">
<a href="https://github.com/pancsta/asyncmachine-go/blob/main/tools/cmd/arpc/README.md">
<img src="https://pancsta.github.io/assets/asyncmachine-go/videos/repl-demo1.gif" alt="REPL" />
</a>
</div>

**Handlers** - [Aspect Oriented](https://en.wikipedia.org/wiki/Aspect-oriented_programming) transition handlers.
Expand Down Expand Up @@ -245,7 +247,7 @@ This monorepo offers the following importable packages and runnable tools:
- [`/tools/cmd/am-dbg`](/tools/cmd/am-dbg/README.md) Multi-client TUI debugger.
- [`/tools/cmd/am-gen`](/tools/cmd/am-gen/README.md) Generates states files and Grafana dashboards.
- [`/tools/cmd/am-vis`](https://github.com/pancsta/asyncmachine-go/pull/216) Generates diagrams of interconnected state machines.
- [`/tools/cmd/arpc`](https://github.com/pancsta/asyncmachine-go/pull/216) Network-native REPL and CLI.
- [`/tools/cmd/arpc`](/tools/cmd/arpc) Network-native REPL and CLI.

[![dashboard](https://pancsta.github.io/assets/asyncmachine-go/am-dbg-dashboard.png)](/tools/cmd/am-dbg/README.md)

Expand Down
3 changes: 3 additions & 0 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1818,5 +1818,8 @@ Each of them has a readme with examples:
- [`/pkg/rpc`](/pkg/rpc/README.md) Remote state machines, with the same API as local ones.
- [`/pkg/states`](/pkg/states/README.md) Reusable state definitions and piping.
- [`/pkg/telemetry`](/pkg/telemetry/README.md) Telemetry exporters for metrics, traces, and logs.
- [`/pkg/pubsub`](/pkg/pubsub/README.md) Decentralized PubSub based on libp2p gossipsub.
- [`/tools/cmd/am-dbg`](/tools/cmd/am-dbg/README.md) am-dbg is a multi-client TUI debugger.
- [`/tools/cmd/am-gen`](/tools/cmd/am-gen/README.md) am-gen generates states files and Grafana dashboards.
- [`/tools/cmd/am-vis`](https://github.com/pancsta/asyncmachine-go/pull/216) Generates diagrams of interconnected state machines.
- [`/tools/cmd/arpc`](/tools/cmd/arpc) Network-native REPL and CLI.
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Table of contents:
- #handlers #composition
- [origin](/pkg/states/README.md#piping)

### [Mach Template](/examples/mach_template/mach_template.go)

- #template #handlers #telemetry #repl #relations #generator #negotiation #multi

### [Raw Strings](/examples/raw_strings/raw_strings.go)

- #relations #handlers #async #negotiation #auto
Expand All @@ -74,6 +78,10 @@ Table of contents:
- #relations
- [origin](/pkg/machine/README.md#mutations-and-relations)

### [REPL](/examples/repl/main.go)

- #arpc #repl

### [Subscriptions](/examples/subscriptions/example_subscriptions.go)

- #waiting
Expand Down
25 changes: 6 additions & 19 deletions examples/repl/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package main

// Steps:
// 1. go run .
// 2. go run github.com/pancsta/asyncmachine-go/tools/cmd/arpc@latest -d tmp

import (
"context"
"fmt"
Expand Down Expand Up @@ -44,25 +48,8 @@ func main() {
worker.Log("hello")
}

// periodically make some changes
t := time.NewTicker(3 * time.Second)
// names := ss.Names()
for {
exit := false
select {
case <-t.C:
// randState := names[rand.N(len(names))]
// worker.Add1(randState, nil)
case <-sigChan:
cancel()
exit = true
case <-ctx.Done():
exit = true
}
if exit {
break
}
}
// wait
<-sigChan

fmt.Println("bye")
}
Expand Down

0 comments on commit dee8e24

Please sign in to comment.