Skip to content
Juvix imports

module tutorial.engines.template_messages;

import prelude open;

Template Messages

These are the messages that the Template engine can receive/respond to.

Message interface

type TemplateMsg :=
| TemplateMsgJustHi
| TemplateMsgExampleRequest ExampleRequest
| TemplateMsgExampleReply ExampleReply;

Message sequence diagrams


ExampleRequest and ExampleReply

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut purus eget sapien. Nulla facilisi.

sequenceDiagram
    participant TemplateClient
    participant Template

    TemplateClient ->> Template: ExampleRequest
    Template ->> TemplateClient: ExampleReplyOk

    TemplateClient ->> Template: ExampleRequest
    Template ->> TemplateClient: ExampleReplyErrorOne
Sequence Diagram: ExampleRequest & ExampleReply

Message types


TemplateMsgJustHi

Lorem ipsum dolor sit amet, consectetur adipiscing elit.


ExampleRequest

Example request.

type ExampleRequest :=
mkExampleRequest@{
argOne : Nat;
argTwo : Nat;
};
Arguments
argOne
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
argTwo
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

ExampleReply

Reply to an ExampleRequest.

Auxiliary Juvix code

ExampleReplyOk

Example OK reply.

type ExampleReplyOk :=
mkExampleReplyOk@{
argOne : Nat;
};

Arguments
argOne
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

ExampleReplyError

Example error reply.

type ExampleReplyError :=
| ExampleErrorOne
| ExampleErrorTwo;

Error types
ExampleErrorOne
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
ExampleErrorTwo
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
ExampleReply : Type := Result ExampleReplyError ExampleReplyOk;

TemplateMsg

type TemplateMsg :=
| TemplateMsgJustHi
| TemplateMsgExampleRequest ExampleRequest
| TemplateMsgExampleReply ExampleReply;

Engine components