Skip to content
Juvix preamble

module arch.node.engines.template;

import prelude open;
import arch.node.engines.template_messages open public;
import arch.node.engines.template_environment open public;
import arch.node.engines.template_behaviour open public;
import arch.node.types.engine open public;

open template_environment_example;

Template Engine

Purpose

Brief summary of the purpose of the engine.

Components

  • Some
  • Useful
  • Links

Type

TemplateEngine : Type :=
Engine
TemplateLocalState
TemplateMailboxState
TemplateTimerHandle
TemplateMatchableArgument
TemplateActionLabel
TemplatePrecomputationList;

Example of a template engine

exampleTemplateEngine : TemplateEngine :=
mkEngine@{
name := "template";
initEnv := templateEnvironment;
behaviour := templateBehaviour
};

where templateEnvironment is defined as follows:

templateEnvironment : TemplateEnvironment :=
mkEngineEnvironment@{
name := "template";
localState :=
mkTemplateLocalState@{
taskQueue :=
mkCustomData@{
word := "taskQueue"
}
};
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := []
};

and templateBehaviour is defined as follows:

templateBehaviour : TemplateBehaviour :=
mkEngineBehaviour@{
guards := [messageOneGuard];
action := templateAction;
conflictSolver := templateConflictSolver
};
(Wiki) links on this page