I am planning to implement an Event Driven system, based on the Actor model using CompletableFutures and individual Thread Pools for each actor.
However my tasks are completely sequential in nature and some of them are Network IO Bound.
Currently I am thinking of implementing it in such a way.
CompletableFuture.supplyAsync( task1.getTask(), task1.getThreadPool ).thenApplyAsync( task2.getTask(), task2.getThreadPool() )....
I am keeping a CPU bound task, then a Network IO Bound, then again a CPU, so on and so forth.
I am aware of libraries like Akka, but I feel even this does the job just fine. Also I am hoping to achieve high-throughput with this model, compared to just executing all of them synchronously.
Is there a flaw in my thinking?