|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.dataflow.stream.DataflowStreamReadAdapter
public final class DataflowStreamReadAdapter extends java.lang.Object
Adapts a DataflowStream to accommodate for the DataflowReadChannel interface. To minimize the overhead and stay in-line with the DataflowStream semantics, the DataflowStreamReadAdapter class is not thread-safe and should only be used from within a single thread. If multiple threads need to read from a DataflowStream, they should each create their own wrapping DataflowStreamReadAdapter.
- The type of messages to pass through the streamField Summary | |
---|---|
private DataflowStream |
asyncHead
|
private DataflowStream |
head
|
Constructor Summary | |
DataflowStreamReadAdapter(DataflowStream stream)
Creates a new adapter |
Method Summary | |
---|---|
T
|
getVal()
|
T
|
getVal(long timeout, java.util.concurrent.TimeUnit units)
|
void
|
getValAsync(MessageStream callback)
|
void
|
getValAsync(java.lang.Object attachment, MessageStream callback)
|
boolean
|
isBound()
|
java.util.Iterator
|
iterator()
|
private void
|
moveAsyncHead()
|
private void
|
moveHead()
|
DataflowExpression
|
poll()
|
void
|
rightShift(groovy.lang.Closure closure)
|
java.lang.String
|
toString()
|
void
|
whenBound(groovy.lang.Closure closure)
|
void
|
whenBound(Pool pool, groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data becomes available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled. |
void
|
whenBound(PGroup group, groovy.lang.Closure closure)
|
void
|
whenBound(MessageStream stream)
|
void
|
wheneverBound(groovy.lang.Closure closure)
|
void
|
wheneverBound(MessageStream stream)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
private DataflowStream asyncHead
private DataflowStream head
Constructor Detail |
---|
public DataflowStreamReadAdapter(DataflowStream stream)
stream
- The stream to wrap
Method Detail |
---|
@Override public T getVal()
@Override public T getVal(long timeout, java.util.concurrent.TimeUnit units)
@Override public void getValAsync(MessageStream callback)
@Override public void getValAsync(java.lang.Object attachment, MessageStream callback)
@Override public boolean isBound()
public java.util.Iterator iterator()
private void moveAsyncHead()
private void moveHead()
@Override public DataflowExpression poll()
@Override public void rightShift(groovy.lang.Closure closure)
@Override public java.lang.String toString()
@Override public void whenBound(groovy.lang.Closure closure)
@Override public void whenBound(Pool pool, groovy.lang.Closure closure)
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data available
@Override public void whenBound(PGroup group, groovy.lang.Closure closure)
@Override public void whenBound(MessageStream stream)
@Override public void wheneverBound(groovy.lang.Closure closure)
@Override public void wheneverBound(MessageStream stream)
Copyright © 2008–2010 Václav Pech. All Rights Reserved.