Package ratpack.exec
Interface Upstream<T>
-
- Type Parameters:
T
- the type of item emitted downstream
public interface Upstream<T>
An upstream asynchronous data source.An upstream can be
connected
at any time to aDownstream
, zero or more times. Once connected, the upstream will at some time in the future invoke one of the downstream'sDownstream.success(T)
,Downstream.error(java.lang.Throwable)
,Downstream.complete()
methods. Only one of these methods will be invoked per downstream that is connected, and only invoked once.An upstream is the producer side of a
Promise
. Unlike aPublisher
, it only produces one value and does not stream.Multiple downstreams can connect to a single upstream.
- See Also:
Promise.transform(Function)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
connect(Downstream<? super T> downstream)
Connect the downstream.
-
-
-
Method Detail
-
connect
void connect(Downstream<? super T> downstream) throws Exception
Connect the downstream.- Parameters:
downstream
- the downstream to emit data to- Throws:
Exception
- any
-
-