Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1027106 - Multi-Stage Processing

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 823K of libraries. Click here for Pure Java version (2221L/12K).

!7

// a stage can be not started, running or done
sclass Stage {
  S stageName;
  //long started, done; // timestamps
  bool done;
  O result;
  //S log;
  
  sS _fieldOrder = "stageName result";
}

cmodule MultiStageProcessing > DynObjectTable<Stage> {
  start {
    itemToMap = func(Stage s) -> Map {
      litorderedmap("Stage Name" := s.stageName, Result := s.done ? str(s.result) : "not done yet")
    };
  }
  
  // API
  
  Stage addStage(S stageName) {
    ret addAndReturn(nu Stage(+stageName));
  }
  
  Stage addStage(S stageName, O result) {
    ret addAndReturn(nu Stage(+stageName, done := true, +result));
  }
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027106
Snippet name: Multi-Stage Processing
Eternal ID of this version: #1027106/14
Text MD5: fddd82ab29728456c4bc516225b0e89a
Transpilation MD5: 0bc634b641e08ee05f871f709b48f27b
Author: stefan
Category: javax / stefan's os / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-20 19:15:40
Source code size: 656 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 49 / 504
Version history: 13 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1027106 & http://1027106.tinybrain.de