You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of the machine-runner library is twofold: it should provide a safe and intuitive API for writing, running, and inspecting state machines, and it should allow static analysis of a set of such state machines plus a swarm protocol to ensure protocol correctness and adherence.
For the first aspect we need the following:
type-safe construction of the initial state (for production code) as well as all other states (for unit tests)
type-safe inspection of an unknown runtime state (“downcasting” and access to properties), e.g. in a UI or a node.js application
type-safe invocation of commands if the runtime state is of a particular name
type-safe formulation of events emitted from commands and events consumed in handlers as per the overall protocol
a generic handler function to be invoked upon reception of an unexpected event
For the second aspect we need the following:
identification of initial state
enumerate all commands including their name, argument type list, and resulting event list
enumerate all event handlers including argument type list and name of the resulting state
These can be captured during unit tests (i.e. by reifying states, events, handler, and commands as objects) or analysed using TypeScript as a library; in either case, the captured machine specification needs to be formatted in JSON and passed to an external type-checking program for swarm protocols (currently implemented in Haskell).
The text was updated successfully, but these errors were encountered:
The purpose of the
machine-runner
library is twofold: it should provide a safe and intuitive API for writing, running, and inspecting state machines, and it should allow static analysis of a set of such state machines plus a swarm protocol to ensure protocol correctness and adherence.For the first aspect we need the following:
For the second aspect we need the following:
These can be captured during unit tests (i.e. by reifying states, events, handler, and commands as objects) or analysed using TypeScript as a library; in either case, the captured machine specification needs to be formatted in JSON and passed to an external type-checking program for swarm protocols (currently implemented in Haskell).
The text was updated successfully, but these errors were encountered: