Package org.jruby.ext.timeout
Class Timeout
java.lang.Object
org.jruby.ext.timeout.Timeout
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static RubyStringdefaultTimeoutMessage(ThreadContext context) static voiddefine(RubyModule timeout) private static RubyClassgetTimeoutError(RubyModule timeout) private static voidkillTimeoutThread(ThreadContext context, ScheduledFuture timeoutFuture, AtomicBoolean latch) static voidprivate static booleannilOrZeroSeconds(ThreadContext context, IRubyObject seconds) private static IRubyObjectraiseTimeoutErrorIfMatches(ThreadContext context, RubyModule timeout, RaiseException ex, Object id) static IRubyObjecttimeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, Block block) static IRubyObjecttimeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, Block block) static IRubyObjecttimeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, IRubyObject message, Block block) private static IRubyObjectyieldWithTimeout(ScheduledThreadPoolExecutor executor, ThreadContext context, IRubyObject seconds, Block block, Runnable runnable, AtomicBoolean latch)
-
Field Details
-
EXECUTOR_VARIABLE
- See Also:
-
TIMEOUT_MESSAGE
-
-
Constructor Details
-
Timeout
public Timeout()
-
-
Method Details
-
load
-
define
-
timeout
public static IRubyObject timeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, Block block) -
defaultTimeoutMessage
-
timeout
public static IRubyObject timeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, Block block) -
timeout
public static IRubyObject timeout(ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, IRubyObject message, Block block) -
nilOrZeroSeconds
-
yieldWithTimeout
private static IRubyObject yieldWithTimeout(ScheduledThreadPoolExecutor executor, ThreadContext context, IRubyObject seconds, Block block, Runnable runnable, AtomicBoolean latch) throws RaiseException - Throws:
RaiseException
-
killTimeoutThread
private static void killTimeoutThread(ThreadContext context, ScheduledFuture timeoutFuture, AtomicBoolean latch) -
raiseTimeoutErrorIfMatches
private static IRubyObject raiseTimeoutErrorIfMatches(ThreadContext context, RubyModule timeout, RaiseException ex, Object id) -
getTimeoutError
-