yf0994 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Generic Push interface that is the opposite of an iterator #1129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Through out many of my projects where ever I do batch stuff I have routinely 
needed something like an Iterator interface but for push.

You can see my stackoverflow post about this here:
http://stackoverflow.com/questions/12198546/generic-writer-outputter-what-reader
-is-to-iterator-what-is-writer-to-x

public interface Consumerator<T> {
    public void consume(T object);
    public boolean isAccepting();
}

I have a feeling it will be unlikely like something like this will be added but 
surely someone else has needed a side-effect callback like this?

Original issue reported on code.google.com by adam.g...@evocatus.com on 30 Aug 2012 at 3:03

GoogleCodeExporter commented 9 years ago
This is a reasonable request but one that has produced long debates a number of 
times, so I'm going to try to head that off here.  We're trying to stay out of 
the business of defining interfaces that aren't used by Guava itself, so I 
encourage you to roll your own.

Original comment by cpov...@google.com on 30 Aug 2012 at 3:14

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08