Top Inners Fields Constructors Methods
org.jruby.ext.timeout

public Class Timeout

extends Object
Class Inheritance
Imports
java.util.concurrent.ExecutionException, .ScheduledFuture, .ScheduledThreadPoolExecutor, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, org.jcodings.specific.UTF8Encoding, org.jruby.Ruby, .RubyClass, .RubyException, .RubyKernel, .RubyModule, .RubyNumeric, .RubyObject, .RubyString, .RubyThread, .RubyTime, org.jruby.anno.JRubyMethod, org.jruby.exceptions.RaiseException, org.jruby.runtime.Helpers, .Block, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.threading.DaemonThreadFactory, org.jruby.util.ByteList

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final String
private static final ByteList

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static RubyString
private static RubyClass
getTimeoutError(ThreadContext context, final RubyModule timeout)

private static void
public static void
load(Ruby runtime)

private static boolean
nilOrZeroSeconds(final ThreadContext context, final IRubyObject seconds)

private static IRubyObject
raiseTimeoutErrorIfMatches(ThreadContext context, final RubyModule timeout, final RaiseException ex, final Object id)

public static IRubyObject
timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, Block block)

public static IRubyObject
timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, Block block)

public static IRubyObject
timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, IRubyObject message, Block block)

private static IRubyObject
yieldWithTimeout(ScheduledThreadPoolExecutor executor, ThreadContext context, final IRubyObject seconds, final Block block, final Runnable runnable, final AtomicBoolean latch)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EXECUTOR_VARIABLEback to summary
public static final String EXECUTOR_VARIABLE
TIMEOUT_MESSAGEback to summary
private static final ByteList TIMEOUT_MESSAGE

Constructor Detail

Timeoutback to summary
public Timeout()

Method Detail

defaultTimeoutMessageback to summary
private static RubyString defaultTimeoutMessage(final ThreadContext context)
getTimeoutErrorback to summary
private static RubyClass getTimeoutError(ThreadContext context, final RubyModule timeout)
killTimeoutThreadback to summary
private static void killTimeoutThread(ThreadContext context, ScheduledFuture<V> timeoutFuture, AtomicBoolean latch)
loadback to summary
public static void load(Ruby runtime)
nilOrZeroSecondsback to summary
private static boolean nilOrZeroSeconds(final ThreadContext context, final IRubyObject seconds)
raiseTimeoutErrorIfMatchesback to summary
private static IRubyObject raiseTimeoutErrorIfMatches(ThreadContext context, final RubyModule timeout, final RaiseException ex, final Object id)
timeoutback to summary
public static IRubyObject timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, Block block)
Annotations
@JRubyMethod
module:true
timeoutback to summary
public static IRubyObject timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, Block block)
Annotations
@JRubyMethod
module:true
timeoutback to summary
public static IRubyObject timeout(final ThreadContext context, IRubyObject recv, IRubyObject seconds, IRubyObject exceptionType, IRubyObject message, Block block)
Annotations
@JRubyMethod
module:true
yieldWithTimeoutback to summary
private static IRubyObject yieldWithTimeout(ScheduledThreadPoolExecutor executor, ThreadContext context, final IRubyObject seconds, final Block block, final Runnable runnable, final AtomicBoolean latch) throws RaiseException
org.jruby.ext.timeout back to summary

private Class Timeout.TimeoutTask

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final RubyThread
pack-priv final IRubyObject
pack-priv final Object
pack-priv final AtomicBoolean
pack-priv final RubyString
pack-priv final RubyModule

Constructor Summary

AccessConstructor and Description
private
TimeoutTask(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final Object id, final IRubyObject exception, final RubyString message)

Method Summary

Modifier and TypeMethod and Description
pack-priv static Timeout.TimeoutTask
newAnonymousTask(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final Object id, final RubyString message)

pack-priv static Timeout.TimeoutTask
newTaskWithException(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final IRubyObject exception, final RubyString message)

private void
private void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentThreadback to summary
pack-priv final RubyThread currentThread
exceptionback to summary
pack-priv final IRubyObject exception
idback to summary
pack-priv final Object id
latchback to summary
pack-priv final AtomicBoolean latch
messageback to summary
pack-priv final RubyString message
timeoutback to summary
pack-priv final RubyModule timeout

Constructor Detail

TimeoutTaskback to summary
private TimeoutTask(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final Object id, final IRubyObject exception, final RubyString message)

Method Detail

newAnonymousTaskback to summary
pack-priv static Timeout.TimeoutTask newAnonymousTask(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final Object id, final RubyString message)
newTaskWithExceptionback to summary
pack-priv static Timeout.TimeoutTask newTaskWithException(final RubyThread currentThread, final RubyModule timeout, final AtomicBoolean latch, final IRubyObject exception, final RubyString message)
raiseAnonymousback to summary
private void raiseAnonymous(ThreadContext context)
raiseExceptionback to summary
private void raiseException()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.