- @Bean
- ChatHome[] chatHomes(
- ChatHomeFactory factory,
- ChatBackendProperties properties,
- StorageStrategy storageStrategy)
- {
- ChatHome[] chatHomes = new ChatHome[properties.getInmemory().getNumShards()];
- storageStrategy
- .read()
- .subscribe(chatRoom ->
- {
- int shard = chatRoom.getShard();
- if (chatHomes[shard] == null)
- chatHomes[shard] = factory.createChatHome(shard);
- });
- return chatHomes;
- }
-