Skip to main content
added 405 characters in body
Source Link

Adding How to use it:

public static void main(String[] args) {
    InfiniteStream<Integer> is = new InfiniteStream<Integer>(10);
    CompletableFuture.runAsync(() -> {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            IntStream.range(0, 100).boxed().forEach(is);
        }
    });
    is.forEach(System.out::println);
}

Adding How to use it:

public static void main(String[] args) {
    InfiniteStream<Integer> is = new InfiniteStream<Integer>(10);
    CompletableFuture.runAsync(() -> {
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            IntStream.range(0, 100).boxed().forEach(is);
        }
    });
    is.forEach(System.out::println);
}
Jamal made a typo
Source Link
Simon Forsberg
  • 59.4k
  • 9
  • 156
  • 309

I did InfiniteStream by implementing Stream and Consumer. You can initiate the stream then consume an object using it. I've ddedadded queueing for it to handle storing more than one value from accept. Please provide feedback.

I did InfiniteStream by implementing Stream and Consumer. You can initiate the stream then consume an object using it. I've dded queueing for it to handle storing more than one value from accept. Please provide feedback.

I did InfiniteStream by implementing Stream and Consumer. You can initiate the stream then consume an object using it. I've added queueing for it to handle storing more than one value from accept. Please provide feedback.

added 3 characters in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

I did InfiniteStreamInfiniteStream by implementing StreamStream and Consumer so youConsumer. You can initiate the stream then consume an object using it, and added. I've dded queueing for it to handle storing more than one value from accept please send me your. Please provide feedback:.

I did InfiniteStream by implementing Stream and Consumer so you can initiate the stream then consume object using it, and added queueing for it to handle storing more than one value from accept please send me your feedback:

I did InfiniteStream by implementing Stream and Consumer. You can initiate the stream then consume an object using it. I've dded queueing for it to handle storing more than one value from accept. Please provide feedback.

Post Reopened by Malachi, rolfl, janos
Code indent fix.
Source Link
rolfl
  • 97.5k
  • 17
  • 218
  • 418
Loading
fixed formatting
Source Link
Malachi
  • 28.7k
  • 11
  • 86
  • 188
Loading
added 5407 characters in body
Source Link
Loading
Post Closed as "Not suitable for this site" by SuperBiasedMan, Vogel612, janos
Source Link
Loading