.toStream()
.toArray(size -> new ChatRoomInfoTo[size]);
- TestClient[] testClients = Flux
+ TestWriter[] testWriters = Flux
.fromStream(IntStream.range(0, NUM_CLIENTS).mapToObj(i -> "user-" + Integer.toString(i)))
- .map(i -> new TestClient(
+ .map(i -> new TestWriter(
containers.haproxy.getMappedPort(8400),
chatRooms,
i))
.doOnNext(testClient -> executorService.execute(testClient))
.toStream()
- .toArray(size -> new TestClient[size]);
+ .toArray(size -> new TestWriter[size]);
Thread.sleep(2000);
Arrays
- .stream(testClients)
+ .stream(testWriters)
.forEach(testClient -> testClient.running = false);
Flux
@Slf4j
-public class TestClient implements Runnable
+public class TestWriter implements Runnable
{
@Override
public void run()
volatile boolean running = true;
- TestClient(Integer port, ChatRoomInfoTo[] chatRooms, String username)
+ TestWriter(Integer port, ChatRoomInfoTo[] chatRooms, String username)
{
webClient = WebClient.create("http://localhost:" + port);
this.chatRooms = chatRooms;