Juvix imports
module arch.node.engines.template_environment;
import prelude open;
import arch.node.engines.template_messages open;
import arch.node.types.engine_environment open;
Template Environment¶
Overview¶
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Mailbox state types¶
Auxiliary Juvix code
syntax alias MailboxOneOne := Nat;
syntax alias MailboxTwoOne := String;
syntax alias MailboxTwoTwo := Bool;
TemplateMailboxStateFirstKind FirstKindMailboxState
¶
type FirstKindMailboxState := mkFirstKindMailboxState@{fieldOne : MailboxOneOne};
This is one family of mailbox states without much complexity.
Arguments
fieldOne
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
TemplateMailboxStateSecondKind SecondKindMailboxState
¶
type SecondKindMailboxState :=
mkSecondKindMailboxState@{
fieldOne : MailboxTwoOne;
fieldTwo : MailboxTwoTwo;
};
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Arguments
fieldOne
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
fieldTwo
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
TemplateMailboxState
¶
type TemplateMailboxState :=
| TemplateMailboxStateFirstKind FirstKindMailboxState
| TemplateMailboxStateSecondKind SecondKindMailboxState;
Local state¶
Auxiliary Juvix code
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
type CustomData := mkCustomData@{word : String};
Arguments
word
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
TemplateLocalState
¶
type TemplateLocalState := mkTemplateLocalState@{taskQueue : CustomData};
Arguments
taskQueue
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Timer handles¶
TemplateTimerHandleFirstOption FirstOptionTimerHandle
¶
type FirstOptionTimerHandle := mkFirstOptionTimerHandle@{argOne : ArgOne};
Lorem ipsum dolor sit amet, consectetur adipiscing elit. The following code is an example of this case.
Arguments
argOne
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
TemplateTimerHandleSecondOption SecondOptionTimerHandle
¶
type SecondOptionTimerHandle :=
mkSecondOptionTimerHandle@{
argOne : String;
argTwo : Bool;
};
Arguments
argOne
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
argTwo
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
TemplateTimerHandle
¶
type TemplateTimerHandle :=
| TemplateTimerHandleFirstOption FirstOptionTimerHandle
| TemplateTimerHandleSecondOption SecondOptionTimerHandle;
The Template Environment¶
TemplateEnvironment
¶
TemplateEnvironment : Type :=
EngineEnvironment TemplateLocalState TemplateMailboxState TemplateTimerHandle;
Instantiation¶
templateEnvironment : TemplateEnvironment :=
mkEngineEnvironment@{
name := "template";
localState :=
mkTemplateLocalState@{
taskQueue :=
mkCustomData@{
word := "taskQueue";
};
};
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := [];
};