Skip to content
Juvix imports

module arch.node.engines.ticker_messages;

import prelude open;

Ticker Messages

Message interface

type TickerMsg :=
| TickerMsgIncrement
| TickerMsgCountRequest
| TickerMsgCountReply CountReply;

Message sequence diagram


Requesting a counter value

sequenceDiagram
    participant Ticker
    participant EngineTickerClient

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

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

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

Message types


TickerMsgIncrement

A TickerMsgIncrement message instructs the engine to increase the counter. This message doesn't require any arguments.


TickerMsgCountRequest

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


CountReply

The CountReply payload contains the counter value.

type CountReply : Type :=
mkCountReply@{
counter : Nat;
};

TickerMsg

type TickerMsg :=
| TickerMsgIncrement
| TickerMsgCountRequest
| TickerMsgCountReply CountReply;

Engine components