One more pass on flatMap/mapMulti

Joe Bowbeer joe.bowbeer at gmail.com
Thu Jan 10 08:49:53 PST 2013


downstream.send works for me.
On Jan 10, 2013 8:36 AM, "Brian Goetz" <brian.goetz at oracle.com> wrote:

> downstream.send?
>
>
> On 1/10/2013 11:24 AM, Joe Bowbeer wrote:
>
>> +1 DownsteamCollector
>>
>> I hope you can find a replacement for yield.
>>
>> On Jan 10, 2013 8:20 AM, "Brian Goetz" <brian.goetz at oracle.com
>> <mailto:brian.goetz at oracle.com**>> wrote:
>>
>>     DownstreamCollector?
>>
>>     On 1/10/2013 11:01 AM, Tim Peierls wrote:
>>
>>         How about Acceptor?
>>
>>         On Thu, Jan 10, 2013 at 10:54 AM, Brian Goetz
>>         <brian.goetz at oracle.com <mailto:brian.goetz at oracle.com**>
>>         <mailto:brian.goetz at oracle.com
>>         <mailto:brian.goetz at oracle.com**>__>> wrote:
>>
>>              Downstream:
>>
>>                   /** A collector for values associated with a given
>> input.
>>                Values can be
>>                    * yielded individually, or in aggregates such as
>>         collections,
>>              arrays, or
>>                    * streams; aggregates are flattened, so that yielding
>>         an array
>>              containing
>>                    * [1, 2] is equivalent to yield(1); yield(2).
>>                    */
>>                   interface Downstream<U> {
>>                       void yield(U element);
>>
>>                       default void yield(Collection<U> collection) {
>>                           for (U u : collection)
>>                               yield(u);
>>                       }
>>
>>                       default void yield(U[] array) {
>>                           for (U u : array)
>>                               yield(u);
>>                       }
>>
>>                       default void yield(Stream<U> stream) {
>>                           stream.forEach(this::yield);
>>                       }
>>                   }
>>
>>              The basic idea is that this is a collector for values.  It
>>         was at
>>              one point called "collector" but now we have something else
>>         called
>>              Collector.
>>
>>
>>
>>


More information about the lambda-libs-spec-observers mailing list