T
- the type of item emitted downstreampublic interface Upstream<T>
An upstream can be connected
at any time to a Downstream
, zero or more times.
Once connected, the upstream will at some time in the future invoke one of the downstream's Downstream.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 a Publisher
, it only produces one value and does not stream.
Multiple downstreams can connect to a single upstream.
Promise.transform(ratpack.func.Function)
Modifier and Type | Method and Description |
---|---|
void |
connect(Downstream<? super T> downstream)
Connect the downstream.
|
void connect(Downstream<? super T> downstream) throws Exception
downstream
- the downstream to emit data toException
- any