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).

static <A> A evalWithTimeoutOrTypedException(int timeoutMS, IF0<A> f) {
  ret evalWithTimeoutOrTypedException(toSeconds(timeoutMS), f);
}

static <A> A evalWithTimeoutOrTypedException(double timeoutSeconds, IF0<A> f) {
  Either<A, Thread> e = evalWithTimeout(timeoutSeconds, f);
  if (e.isA()) ret (A) e.a();
  throw TimeoutException_Inner(
    timeoutSeconds,
    f,
    e.b());
}

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: 96 / 186
Version history: 5 change(s)
Referenced in: [show references]