final StatefulDynamicDispatchActor downloader = new WriteStatefulDynamicDispatchActor();
downloader.follower = indexer;
indexer.follower = writer;
final PGroup group = new DefaultPGroup(new DefaultPool(false, 4));
writer.setParallelGroup(group);
indexer.setParallelGroup(group);
downloader.setParallelGroup(group);
downloader.follower = indexer;
indexer.follower = writer;
writer.silentStart();
indexer.silentStart();
downloader.silentStart();
final long t1 = System.currentTimeMillis();
long i = 0;
while (i < 1000000L) {
downloader.send("Requested " + i);
i++;
}
downloader.send(new StopMessage());
downloader.join();
indexer.join();
writer.join();
final long t2 = System.currentTimeMillis();
System.out.println(t2 - t1);
group.shutdown();
}