| Modifier and Type | Class and Description |
|---|---|
private static class |
Timeout.TimeoutTask |
static class |
Timeout.TimeoutToplevel |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.concurrent.ScheduledExecutorService |
timeoutExecutor |
| Constructor and Description |
|---|
Timeout() |
| Modifier and Type | Method and Description |
|---|---|
private static RubyClass |
getAnonymousException(IRubyObject timeout) |
private static RubyClass |
getClassFrom(IRubyObject timeout,
java.lang.String name) |
private static void |
killTimeoutThread(ThreadContext context,
java.util.concurrent.Future timeoutFuture,
java.util.concurrent.atomic.AtomicBoolean latch) |
void |
load(Ruby runtime,
boolean wrap) |
private static boolean |
nilOrZeroSeconds(ThreadContext context,
IRubyObject seconds) |
private static IRubyObject |
raiseBecauseCritical(ThreadContext context) |
private static IRubyObject |
raiseTimeoutErrorIfMatches(ThreadContext context,
IRubyObject timeout,
RaiseException ex,
IRubyObject id) |
static IRubyObject |
timeout(ThreadContext context,
IRubyObject recv,
IRubyObject seconds,
Block block) |
static IRubyObject |
timeout(ThreadContext context,
IRubyObject recv,
IRubyObject seconds,
IRubyObject exceptionType,
Block block) |
private static IRubyObject |
yieldWithTimeout(ThreadContext context,
IRubyObject seconds,
Block block,
java.lang.Runnable runnable,
java.util.concurrent.atomic.AtomicBoolean latch) |
private static java.util.concurrent.ScheduledExecutorService timeoutExecutor
public void load(Ruby runtime, boolean wrap) throws java.io.IOException
public static IRubyObject timeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, Block block)
public static IRubyObject timeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, Block block)
private static boolean nilOrZeroSeconds(ThreadContext context, IRubyObject seconds)
private static IRubyObject yieldWithTimeout(ThreadContext context, IRubyObject seconds, Block block, java.lang.Runnable runnable, java.util.concurrent.atomic.AtomicBoolean latch) throws RaiseException
RaiseExceptionprivate static void killTimeoutThread(ThreadContext context, java.util.concurrent.Future timeoutFuture, java.util.concurrent.atomic.AtomicBoolean latch)
private static IRubyObject raiseBecauseCritical(ThreadContext context)
private static IRubyObject raiseTimeoutErrorIfMatches(ThreadContext context, IRubyObject timeout, RaiseException ex, IRubyObject id)
private static RubyClass getAnonymousException(IRubyObject timeout)
private static RubyClass getClassFrom(IRubyObject timeout, java.lang.String name)