ChatroomFactory chatroomFactory,
StorageStrategy storageStrategy)
{
- return new ChatHome(
- storageStrategy.readChatrooms().collectMap(chatroom -> chatroom.getId()).block(),
- chatroomFactory);
+ return new ChatHome(chatroomFactory, storageStrategy.readChatrooms());
}
@Bean
public StorageStrategy storageStrategy(
ChatBackendProperties properties,
ObjectMapper mapper,
- ChatroomFactory chatroomFactory)
+ InMemoryChatroomFactory chatroomFactory)
{
return new LocalJsonFilesStorageStrategy(
Paths.get(properties.getDatadir()),
}
@Bean
- ChatroomFactory chatroomFactory()
+ InMemoryChatroomFactory chatroomFactory(ChatBackendProperties properties)
{
- return new InMemoryChatroomFactory();
+ return new InMemoryChatroomFactory(properties.getChatroomBufferSize());
}
@Bean