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

11
LINES

< > BotCompany Repo | #1035514 // waitForPredicateUsingChangeListener

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9591L/53K).

1  
sbool waitForPredicateUsingChangeListener(IF0<Bool> pred, IHasChangeListeners sender) {
2  
  new BoolVar trigger;
3  
  
4  
  temp tempOnChange(sender, -> trigger.set(true));
5  
  
6  
  while true {
7  
    ping();
8  
    if (pred!) true;
9  
    trigger.waitUntilTrueAndClear();
10  
  }
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035514
Snippet name: waitForPredicateUsingChangeListener
Eternal ID of this version: #1035514/4
Text MD5: 5fc23e16a563999e2955e30c01bb1f8d
Transpilation MD5: c6115516f2449d7ad1679e8c73b9aa93
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-01 23:56:19
Source code size: 268 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 162 / 221
Version history: 3 change(s)
Referenced in: [show references]