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

12
LINES

< > BotCompany Repo | #1034248 // evalWithTimeoutOrTypedException

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

Libraryless. Click here for Pure Java version (6164L/34K).

1  
static <A> A evalWithTimeoutOrTypedException(int timeoutMS, IF0<A> f) {
2  
  ret evalWithTimeoutOrTypedException(toSeconds(timeoutMS), f);
3  
}
4  
5  
static <A> A evalWithTimeoutOrTypedException(double timeoutSeconds, IF0<A> f) {
6  
  Either<A, Thread> e = evalWithTimeout(timeoutSeconds, f);
7  
  if (e.isA()) ret (A) e.a();
8  
  throw TimeoutException_Inner(
9  
    timeoutSeconds,
10  
    f,
11  
    e.b());
12  
}

Author comment

Began life as a copy of #1018060

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034248
Snippet name: evalWithTimeoutOrTypedException
Eternal ID of this version: #1034248/6
Text MD5: e159af0a35f65b04ddc82e425bcaba82
Transpilation MD5: d8514cb381e3d6e6781472989a0ab6d9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-11 03:38:53
Source code size: 392 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 152 / 269
Version history: 5 change(s)
Referenced in: [show references]