- public ChatHome chatHome(ChatHomeService chatHomeService)
- {
- return new ChatHome(chatHomeService);
- }
-
- @Bean
- InMemoryChatHomeService chatHomeService(
- StorageStrategy storageStrategy,
- Clock clock,
- ChatBackendProperties properties)
- {
- return new InMemoryChatHomeService(
- storageStrategy.readChatrooms(),
- clock,
- properties.getChatroomBufferSize());
- }
-
- @Bean
- public StorageStrategy storageStrategy(
- ChatBackendProperties properties,
- Clock clock,
- ObjectMapper mapper)
- {
- return new FilesStorageStrategy(
- Paths.get(properties.getStorageDirectory()),
- clock,
- properties.getChatroomBufferSize(),
- messageFlux -> new InMemoryChatRoomService(messageFlux),
- mapper);
- }
-
- @Bean
- public Clock clock()