Juvix preamble
module node_architecture.engines.ticker;
import node_architecture.engines.ticker_messages open public;
import node_architecture.engines.ticker_environment open public;
import node_architecture.engines.ticker_behaviour open public;
import prelude open;
import node_architecture.types.engine open;
Ticker Engine¶
The Ticker engine provides a simple counter functionality, allowing clients to increment a counter and retrieve its current value.
Purpose¶
A ticker engine maintains a counter in its local state. It increases the counter
when it receives an Increment
message and provides the updated result upon
receiving a Count
message. The initial state initializes the counter.
Components¶
Useful links¶
Type¶
TickerBehaviour
¶
TickerBehaviour
: EngineBehaviour
TickerLocalState
TickerMailboxState
TickerTimerHandle
TickerMatchableArgument
TickerActionLabel
TickerPrecomputation :=
mkEngineBehaviour@{
guards := [incrementGuard; countGuard];
action := tickerAction;
conflictSolver := tickerConflictSolver
};
TickerEngine
¶
TODO juvix
TickerEngine : Engine
TickerLocalState
TickerMailboxState
TickerTimerHandle
TickerMatchableArgument
TickerActionLabel
TickerPrecomputation := mkEngine@{
name := "ticker";
behaviour := TickerBehaviour;
initEnv := mkEngineEnvironment@{
name := "ticker";
localState := Unit;
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := [];
};
};