Skip to content
Juvix imports

module node_architecture.engines.ticker_overview;

Ticker Engine Family Overview

TickerEngineFamily
: Anoma.EngineFamily
TickerLocalState
TickerMailboxState
TickerTimerHandle
TickerMatchableArgument
TickerActionLabel
TickerPrecomputation :=
Anoma.mkEngineFamily@{
guards := [incrementGuard; countGuard];
action := tickerAction;
conflictSolver := tickerConflictSolver
};

The Ticker engine family 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.

Message interface

type TickerMsg :=
| Increment
| Count;

There are only two message tags: Increment, which increases the counter state of the ticker, and Count, which the ticker responds to with the current counter state.

Increment message

Increment

Increment

An Increment message instructs the engine to increase the counter. This message doesn't require any arguments.

Count message

Count

Count

A Count message requests the engine to send the current counter value back to the requester. This message doesn't require any arguments.

Message sequence diagrams

Ticker Interaction Diagram

This diagram represents a simple interaction between a Ticker engine instance and another entity sending increment requests and count requests.

sequenceDiagram
    participant Ticker
    participant EngineTickerClient

    EngineTickerClient ->> Ticker: Send Increment
    Note over Ticker: Counter = 1

    EngineTickerClient ->> Ticker: Send Increment
    Note over Ticker: Counter = 2

    EngineTickerClient ->> Ticker: Send Count
    Ticker ->> EngineTickerClient: Respond with Counter (2)
A client interacts with the Ticker engine, which increments and responds with the counter value.

Engine Components

(Wiki) links on this page