Libraryless. Click here for Pure Java version (9591L/53K).
sbool waitForPredicateUsingChangeListener(IF0<Bool> pred, IHasChangeListeners sender) { new BoolVar trigger; temp tempOnChange(sender, -> trigger.set(true)); while true { ping(); if (pred!) true; trigger.waitUntilTrueAndClear(); } }
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: | 161 / 220 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1035516 - waitForCalculatedValueUsingChangeListener - returns as soon as a non-null value is calculated |