import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
import java.util.*;
{
return Mono.error(e);
}
- })
- .doOnNext(message ->
- {
- list.add(message);
- log.info(
- "Received a message from chat-room {}: {}",
- chatRoom.getName(),
- message);
});
- })
- .takeUntil(message -> !running)
- .doOnComplete(() -> log.info("TestListener is done"));
+ });
}
Flux<ServerSentEvent<String>> receiveMessages(ChatRoomInfoTo chatRoom)
final Map<UUID, List<MessageTo>> receivedMessages = new HashMap<>();
- volatile boolean running = true;
-
TestListener(Integer port, ChatRoomInfoTo[] chatRooms)
{