module arch.node.engines.executor;

import prelude open;
import arch.node.types.engine open;

import arch.node.engines.executor_config open public;
import arch.node.engines.executor_messages open public;
import arch.node.engines.executor_environment open public;
import arch.node.engines.executor_behaviour open public;

import arch.node.types.anoma as Anoma open;

open executor_config_example;
open executor_environment_example;

ExecutorEngine (KVSKey KVSDatum Executable ProgramState : Type) : Type :=
  Engine
    (ExecutorCfg KVSKey Executable)
    (ExecutorLocalState KVSKey KVSDatum ProgramState)
    ExecutorMailboxState
    ExecutorTimerHandle
    ExecutorActionArguments
    (Anoma.PreMsg KVSKey KVSDatum Executable)
    (Anoma.PreCfg KVSKey KVSDatum Executable)
    (Anoma.PreEnv KVSKey KVSDatum Executable ProgramState);

exampleExecutorEngine : ExecutorEngine String String ByteString String :=
  mkEngine@{
    cfg := executorCfg;
    env := executorEnv;
    behaviour := executorBehaviour;
  };