groovyx.gpars.dataflow
Interface SelectableChannel<T>

All Known Subinterfaces:
DataflowChannel<T>, DataflowReadChannel<T>, Promise<T>
All Known Implementing Classes:
DataflowComplexExpression, DataflowExpression, DataflowExpression.TransformMany, DataflowExpression.TransformOne, DataflowGetPropertyExpression, DataflowInvocationExpression, DataflowQueue, DataflowStreamReadAdapter, DataflowVariable, DataflowVariable.RemoteDataflowVariable, LazyDataflowVariable, RemoteDataflowExpression, SyncDataflowQueue, SyncDataflowStreamReadAdapter, SyncDataflowVariable

public interface SelectableChannel<T>

Created with IntelliJ IDEA. User: Vaclav Date: 5.7.13 Time: 22:17 To change this template use File | Settings | File Templates.


Method Summary
 DataflowExpression<T> poll()
          Retrieves the value at the head of the buffer.
<V> void
wheneverBound(groovy.lang.Closure<V> closure)
          Send all pieces of data bound in the future to the provided stream when it becomes available
 void wheneverBound(MessageStream stream)
          Send all pieces of data bound in the future to the provided stream when it becomes available.
 

Method Detail

wheneverBound

<V> void wheneverBound(groovy.lang.Closure<V> closure)
Send all pieces of data bound in the future to the provided stream when it becomes available. *

Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.

wheneverBound

void wheneverBound(MessageStream stream)
Send all pieces of data bound in the future to the provided stream when it becomes available.

Parameters:
stream - stream where to send result

poll

DataflowExpression<T> poll()
                           throws java.lang.InterruptedException
Retrieves the value at the head of the buffer. Returns null, if no value is available.

Returns:
The value bound to the DFV at the head of the stream or null
Throws:
java.lang.InterruptedException - If the current thread is interrupted

Copyright © 2008–2013 Václav Pech. All Rights Reserved.