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 911K of libraries. Click here for Pure Java version (2221L/12K).

1  
!7
2  
3  
// a stage can be not started, running or done
4  
sclass Stage {
5  
  S stageName;
6  
  //long started, done; // timestamps
7  
  bool done;
8  
  O result;
9  
  //S log;
10  
  
11  
  sS _fieldOrder = "stageName result";
12  
}
13  
14  
cmodule MultiStageProcessing > DynObjectTable<Stage> {
15  
  start {
16  
    itemToMap = func(Stage s) -> Map {
17  
      litorderedmap("Stage Name" := s.stageName, Result := s.done ? str(s.result) : "not done yet")
18  
    };
19  
  }
20  
  
21  
  // API
22  
  
23  
  Stage addStage(S stageName) {
24  
    ret addAndReturn(nu Stage(+stageName));
25  
  }
26  
  
27  
  Stage addStage(S stageName, O result) {
28  
    ret addAndReturn(nu Stage(+stageName, done := true, +result));
29  
  }
30  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, 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: 196 / 744
Version history: 13 change(s)
Referenced in: [show references]