T
- the type of item emitted by this publisherpublic interface TransformablePublisher<T>
extends org.reactivestreams.Publisher<T>
Publisher
that makes it more convenient to chain transformations of different kinds.
Note that this type implements the publisher interface, so behaves just like the publisher that it is wrapping with respect to the Publisher.subscribe(org.reactivestreams.Subscriber)
method.
Modifier and Type | Method and Description |
---|---|
default TransformablePublisher<T> |
buffer()
|
default <O> TransformablePublisher<O> |
flatMap(Function<? super T,? extends Promise<? extends O>> function)
|
default TransformablePublisher<T> |
gate(Action<? super Runnable> valveReceiver)
|
default <O> TransformablePublisher<O> |
map(Function<? super T,? extends O> function)
|
default TransformablePublisher<T> |
multicast()
|
default Promise<T> |
toPromise()
|
default Promise<T> |
toPromise(ExecControl execControl)
|
default <O> TransformablePublisher<O> |
transform(Function<? super TransformablePublisher<T>,? extends org.reactivestreams.Publisher<O>> transformer)
Convenience method to allow a non Ratpack publisher transform method to be hooked in.
|
default TransformablePublisher<T> |
wiretap(Action<? super StreamEvent<? super T>> listener)
|
default <O> TransformablePublisher<O> map(Function<? super T,? extends O> function)
O
- the type of transformed itemfunction
- the transformationdefault <O> TransformablePublisher<O> flatMap(Function<? super T,? extends Promise<? extends O>> function)
O
- the type of transformed itemfunction
- the transformationdefault TransformablePublisher<T> buffer()
default TransformablePublisher<T> gate(Action<? super Runnable> valveReceiver)
valveReceiver
- an action that receives a runnable “valve” that when run allows request to start flowing upstreamdefault TransformablePublisher<T> wiretap(Action<? super StreamEvent<? super T>> listener)
listener
- the listener for emitted itemsdefault TransformablePublisher<T> multicast()
default Promise<T> toPromise(ExecControl execControl)
execControl
- the exec control to create the promise fromdefault <O> TransformablePublisher<O> transform(Function<? super TransformablePublisher<T>,? extends org.reactivestreams.Publisher<O>> transformer)
This transformable publisher will be given to the function, that should return a new publisher. The returned publisher will then be wrapped in a transformable wrapper which will be returned by this method.
O
- the type of transformed itemtransformer
- a publisher transformer