private static class RubyEnumerator.ThreadedNexter extends RubyEnumerator.Nexter implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEBUG |
protected boolean |
die
death mark
|
private IRubyObject |
doneObject
whether we're done iterating
|
private java.util.concurrent.Future |
future
future to cancel job if it has not started
|
private IRubyObject |
lastValue
the last value we got, used for peek
|
private java.util.concurrent.SynchronousQueue<IRubyObject> |
out
sync queue to wait for values
|
private java.lang.Thread |
thread
thread that's executing this Nexter
|
method, methodArgs, object, runtime| Constructor and Description |
|---|
ThreadedNexter(Ruby runtime,
IRubyObject object,
java.lang.String method,
IRubyObject[] methodArgs) |
| Modifier and Type | Method and Description |
|---|---|
private void |
ensureStarted() |
IRubyObject |
next() |
IRubyObject |
peek() |
private IRubyObject |
peekTake() |
private IRubyObject |
returnValue(IRubyObject value) |
void |
run() |
void |
shutdown() |
private IRubyObject |
take() |
private static final boolean DEBUG
private java.util.concurrent.SynchronousQueue<IRubyObject> out
private volatile java.lang.Thread thread
private IRubyObject doneObject
private java.util.concurrent.Future future
protected volatile boolean die
private IRubyObject lastValue
public ThreadedNexter(Ruby runtime, IRubyObject object, java.lang.String method, IRubyObject[] methodArgs)
public IRubyObject next()
next in class RubyEnumerator.Nexterpublic void shutdown()
shutdown in class RubyEnumerator.Nexterpublic IRubyObject peek()
peek in class RubyEnumerator.Nexterprivate void ensureStarted()
private IRubyObject peekTake()
private IRubyObject take()
private IRubyObject returnValue(IRubyObject value)
public void run()
run in interface java.lang.Runnable