[READ-ONLY] Mirror of https://github.com/andrioid/statesman. xstate inspired schema compatible statechart library for Go
fsm
go
statecharts
1package statesman
2
3// EventBase is the only constraint the core runtime places on events. Every
4// event type implements it; each generated machine narrows it to a sealed Event
5// interface (an unexported marker method) that only that package's types satisfy.
6type EventBase interface {
7 // EventType returns the wire/descriptor name used to match transitions,
8 // e.g. "SUBMIT" or "done.invoke.charge".
9 EventType() string
10}
11
12// Never is an uninhabited event type: it declares an unexported marker no type
13// can satisfy, so a value of type Never cannot be constructed. A ref parametrized
14// with Never (a promise or observable actor) is therefore not sendable — Send
15// cannot be called because no argument exists. See docs and decision 45.
16type Never interface {
17 EventBase
18 isNever()
19}