diff --git a/core/core-util/src/main/java/org/webpieces/util/futures/LoopingChain.java b/core/core-util/src/main/java/org/webpieces/util/futures/LoopingChain.java deleted file mode 100644 index 8c4ddadac..000000000 --- a/core/core-util/src/main/java/org/webpieces/util/futures/LoopingChain.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.webpieces.util.futures; - -import java.util.List; -import org.webpieces.util.futures.XFuture; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; - -//TODO(dhiller): Use this http2engine(client/server), http1 client, http2to11client AND frontend as -//all of them do this pattern and we should wire that all up -public class LoopingChain { - - public XFuture runLoop(List newData, Session session, Processor processFunction) { - - //All the below futures must be chained with previous ones in case previous ones are not - //done which will serialize it all to be in sequence - XFuture future = session.getProcessFuture(); - - for(T data : newData) { - //VERY IMPORTANT: Writing the code like this would slam through calling process N times - //BUT it doesn't give the clients a chance to seet a flag between packets - //Mainly done for exceptions and streaming so you can log exc, set a boolean so you - //don't get 100 exceptions while something is happening like socket disconnect - //In these 2 lines of code, processCorrectly is CALLED N times RIGHT NOW - //The code below this only calls them right now IF AND ONLY IF the client returns - //a completed future each time!!! - - //This seems to have memory issues as well.... - //XFuture temp = processFunction.process(data); - //future = future.thenCompose(f -> temp); - - //future = future.thenComposeAsync( voidd -> processFunction.process(data), executor ); - future = future.thenCompose( voidd -> processFunction.process(data) ); - } - - //comment this out and memory leak goes away of course....... - session.setProcessFuturee(future); - - return future; - } - -} diff --git a/core/core-util/src/main/java/org/webpieces/util/futures/Processor.java b/core/core-util/src/main/java/org/webpieces/util/futures/Processor.java deleted file mode 100644 index 368f65ede..000000000 --- a/core/core-util/src/main/java/org/webpieces/util/futures/Processor.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.webpieces.util.futures; - -import org.webpieces.util.futures.XFuture; - -public interface Processor { - - public XFuture process(T item); -} diff --git a/core/core-util/src/main/java/org/webpieces/util/futures/Session.java b/core/core-util/src/main/java/org/webpieces/util/futures/Session.java deleted file mode 100644 index 3c313b533..000000000 --- a/core/core-util/src/main/java/org/webpieces/util/futures/Session.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.webpieces.util.futures; - -import org.webpieces.util.futures.XFuture; - -public interface Session { - - void setProcessFuturee(XFuture future); - - XFuture getProcessFuture(); - -}