Skip to content

Commit f649f18

Browse files
committed
chore: updates readmes
1 parent dfd474d commit f649f18

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

BREAKING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Only `pkg/machine` and `pkg/states` adhere to semver. Semver of other packages i
44

55
## v0.10
66

7-
- `FooBar` handlers execute later and more often
8-
- `FooAny`, `AnyFoo` handlers has been removed
7+
- `FooBar` handlers get execute later and more often
8+
- `FooAny`, `AnyFoo` handlers have been removed
99
- `AnyAny` is now `AnyEnter`
1010

1111
## v0.9

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ It has atomic transitions, relations, [transparent RPC](/pkg/rpc/README.md), [TU
3838
[telemetry](/pkg/telemetry/README.md), [workers](/pkg/node/README.md), and soon diagrams.
3939

4040
Its main purpose is workflows (in-process or distributed), although it can be used for a wide range of
41-
stateful applications - daemons, UIs, bots, agents, firewalls, consensus algos, etc. **asyncmachine** can precisely (and
42-
transparently) target a specific point in a scenario and easily bring structure to event-based systems. It takes care of
43-
most contexts, `select` statements, and panics.
41+
stateful applications - daemons, UIs, configs, bots, agents, firewalls, consensus algos, etc. **asyncmachine** can
42+
precisely (and transparently) target a specific point in a scenario and easily bring structure to event-based systems.
43+
It takes care of most contexts, `select` statements, and panics.
4444

4545
It aims at creating **autonomous** workflows with **organic** control flow and **stateful** APIs:
4646

4747
- **autonomous** - automatic states, relations, context-based decisions
4848
- **organic** - relations, negotiation, cancellation
4949
- **stateful** - maintaing context, responsive, atomic
5050

51+
![diagrams](https://github.com/pancsta/assets/blob/main/asyncmachine-go/am-vis.svg?raw=true)
52+
5153
## Stack
5254

5355
Top layers depend on the bottom ones.
@@ -135,8 +137,8 @@ mach.Add1("Foo", nil)
135137
mach.Is1("Foo") // false
136138
```
137139

138-
**Complicated** - wait on a multi state (event) and a sync state (Ready) with
139-
1s timeout, and mutate with typed args, on top of a state context.
140+
**Complicated** - wait on a multi state (event) and Ready state with 1s
141+
timeout, and mutate with typed args, on top of a state context.
140142

141143
```go
142144
// state ctx is an expiration ctx
@@ -218,7 +220,7 @@ All examples and benchmarks can be found in [`/examples`](/examples/README.md).
218220

219221
## Getting Started
220222

221-
🦾 [`/pkg/machine`](pkg/machine/README.md) is the main package, while [`/pkg/node`](pkg/node) is
223+
🦾 **[`/pkg/machine`](pkg/machine/README.md)** is the main package, while [`/pkg/node`](pkg/node) is
222224
the high-level usage. Examples in [`/examples`](/examples/README.md) are good for a general grasp, while [`/docs/manual.md`](/docs/manual.md)
223225
and [`/docs/diagrams.md`](/docs/diagrams.md) go deeper into implementation details. Reading tests is always a good idea.
224226

docs/manual.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ inactive**. A list (slice) of state ticks forms a **machine clock**. The sum of
184184
current **machine time**.
185185

186186
Machine clock is a [logical clock](https://en.wikipedia.org/wiki/Logical_clock), which purpose is to distinguish
187-
different instances of the same state. It's most commonly used by in the form of `context.Context` via
187+
different instances of the same state. It's most commonly used in the form of `context.Context` via
188188
[`Machine.NewStateCtx(state string)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.NewStateCtx),
189189
but it also provides methods on its own data type [`am.Time`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Time).
190190

@@ -247,10 +247,10 @@ Methods to check the active states:
247247

248248
- [`Machine.Is(states)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Is)
249249
- [`Machine.Is1(state)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Is1)
250-
- [`Not(states)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Not)
251-
- [`Not1(state)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Not1)
252-
- [`Any(states1, states2...)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Any)
253-
- [`Any1(state1, state2...)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Any1)
250+
- [`Machine.Not(states)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Not)
251+
- [`Machine.Not1(state)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Not1)
252+
- [`Machine.Any(states1, states2...)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Any)
253+
- [`Machine.Any1(state1, state2...)`](https://pkg.go.dev/github.com/pancsta/asyncmachine-go/pkg/machine#Machine.Any1)
254254

255255
Methods to inspect / dump the currently active states:
256256

@@ -386,8 +386,11 @@ States usually belong to one of these categories:
386386
1. Input states (e.g. RPC msgs)
387387
2. Read-only states (e.g. external state / UI state / summaries)
388388
3. Action states (e.g. Start, ShowModal, public API methods)
389+
4. Background tasks (e.g. Processing)
390+
5. Joining states (e.g. ProcessingDone)
389391

390-
Action states often de-activate themselves after they are done, as a part of their [final handler](#final-handlers).
392+
_Action states_ often de-activate themselves after they are done, as a part of their [final handler](#final-handlers). _Joining
393+
states_ are used for relations with other states, as relations to an inactive state are not possible.
391394

392395
**Example** - self removal
393396

@@ -844,7 +847,7 @@ Side effects:
844847
845848
[Mutations](/docs/manual.md#mutations) are the heartbeat of asyncmachine, while [relations](/docs/manual.md#relations)
846849
define the rules of the flow. Each [state](#defining-states) can have 4 types of **relations**. Each relation accepts a
847-
list of state names. Relations guarantee optional consistency among [active states](#active-states).
850+
list of state names. Relations guarantee consistency among [active states](#active-states).
848851
849852
Relations form a Directed Cyclic Graph (DCG), but are not Turing complete, as they guarantee termination. Only
850853
[auto states](#auto-states) trigger a single, automatic mutation attempt.

0 commit comments

Comments
 (0)