Flux<ChatRoomInfo> getChatRoomInfo();
Mono<ChatRoomData> getChatRoomData(UUID id);
-
- Flux<ChatRoomData> getChatRoomData();
}
@Slf4j
public class ShardedChatHome implements ChatHome
{
- private final ChatHome[] chatHomes;
+ private final SimpleChatHome[] chatHomes;
private final Set<Integer> ownedShards;
private final ShardingStrategy shardingStrategy;
public ShardedChatHome(
- ChatHome[] chatHomes,
+ SimpleChatHome[] chatHomes,
ShardingStrategy shardingStrategy)
{
this.chatHomes = chatHomes;
: throwable);
}
- @Override
public Flux<ChatRoomData> getChatRoomData()
{
return Flux
.switchIfEmpty(Mono.error(() -> new UnknownChatroomException(id)));
}
- @Override
public Flux<ChatRoomData> getChatRoomData()
{
return Flux.fromIterable(chatRoomData.values());
chatRoomChannel.getOwnedShards())));
}
- @Override
public Flux<ChatRoomData> getChatRoomData()
{
return chatRoomChannel.getChatRoomData();
{
start();
- assertThat(chathome.getChatRoomData().toStream()).hasSize(0);
+ assertThat(chathome.getChatRoomInfo().toStream()).hasSize(0);
UUID chatRoomId = UUID.fromString("5c73531c-6fc4-426c-adcb-afc5c140a0f7");
ChatRoomInfo info = chathome.createChatRoom(chatRoomId, "FOO").block();
{
start();
- assertThat(chathome.getChatRoomData().toStream()).hasSize(0);
+ assertThat(chathome.getChatRoomInfo().toStream()).hasSize(0);
UUID chatRoomAId = UUID.fromString("5c73531c-6fc4-426c-adcb-afc5c140a0f7");
ChatRoomInfo infoA = chathome.createChatRoom(chatRoomAId, "FOO").block();