.run()
.toFuture();
- log.info("Sleepint for 3 seconds...");
+ log.info("Sleeping for 3 seconds...");
Thread.sleep(3000);
for (int i = 0; i < NUM_CLIENTS; i++)
{
testWriters[i].running = false;
testWriterFutures[i].join();
- log.info("Joined TestWriter {}", testWriters[i]);
+ log.info("Joined TestWriter {}", testWriters[i].user);
}
+
+ log.info("Sleeping for 3 seconds...");
+ Thread.sleep(3000);
+ log.info("Joining TestListener...");
testListener.running = false;
testListenerFuture.join();
log.info("Joined TestListener");
.fromArray(chatRooms)
.flatMap(chatRoom ->
{
+ log.info("Requesting messages from chat-room {}", chatRoom);
List<MessageTo> list = new LinkedList<>();
receivedMessages.put(chatRoom.getId(), list);
return receiveMessages(chatRoom)
list.add(message);
log.info(
"Received a message from chat-room {}: {}",
- chatRoom,
+ chatRoom.getName(),
message);
})
- .take(30);
+ .take(10);
})
+ .take(100)
.takeUntil(message -> !running)
.doOnComplete(() -> log.info("TestListener is done"))
- .parallel()
+ .parallel(chatRooms.length)
.runOn(Schedulers.parallel())
.then();
}
})
.takeUntil(message -> !running)
.doOnComplete(() -> log.info("TestWriter {} is done", user))
- .parallel()
+ .parallel(1)
.runOn(Schedulers.parallel())
.then();
}