diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java')
-rw-r--r-- | bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java index 6d5953e34..071c9ec7d 100644 --- a/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java +++ b/bundles/org.eclipse.equinox.log.stream/osgi/src/org/osgi/util/pushstream/PushStream.java @@ -104,6 +104,26 @@ public interface PushStream<T> extends AutoCloseable { <R> PushStream<R> map(Function< ? super T, ? extends R> mapper); /** + * Asynchronously map the payload values. The mapping function returns a + * Promise representing the asynchronous mapping operation. + * <p> + * The PushStream limits the number of concurrently running mapping + * operations, and returns back pressure based on the number of existing + * queued operations. + * + * @param n number of simultaneous promises to use + * @param delay Nr of ms/promise that is queued back pressure + * @param mapper The mapping function + * @return Builder style (can be a new or the same object) + * @throws IllegalArgumentException if the number of threads is < 1 or + * the delay is < 0 + * @throws NullPointerException if the mapper is null + */ + <R> PushStream<R> asyncMap(int n, int delay, + Function< ? super T,Promise< ? extends R>> mapper) + throws IllegalArgumentException, NullPointerException; + + /** * Flat map the payload value (turn one event into 0..n events of * potentially another type). * |