micronaut-discovery-client icon indicating copy to clipboard operation
micronaut-discovery-client copied to clipboard

Create a Blocking Configuration Client

Open sdelamo opened this issue 10 months ago • 4 comments

Currently, ConfigurationClient has a reactive API.

However, DistributedPropertySourceLocator blocks Block.

I think we should create a BlockingConfigurationClient and heavily simplify code such as SpringCloudConfigurationClient.

@micronaut-projects/core-developers thoughts?

sdelamo avatar Jan 10 '25 12:01 sdelamo

What's the advantage of a new API? You can just block and return a Publishers.just, if you want. It shouldn't cause any issues.

yawkat avatar Jan 24 '25 08:01 yawkat

the advantage is to provide to provide an API which does not force developers to write reactive code.

Also, if you don't have any @ConfigurationClient and only @BlockingConfigurationClient you don't go into unnecessary reactive paths even if it is just doing Publishers::just

sdelamo avatar Jan 24 '25 08:01 sdelamo

Given that I often see reactive code as unnecessarily complex, I'm +1 :)

melix avatar Jan 24 '25 08:01 melix

How about you just rewrite the existing clients to block and use Publishers.just, and then for 5.0 we can do the api change. That way we don't need two apis that do the same thing living next to each other.

yawkat avatar Jan 24 '25 09:01 yawkat