(minor) Add warm-up to GrpcMultiNodeChannelPool to speed up the initial messages

Without doing this, connections would be created lazily, which is probably never desirable.
This commit is contained in:
Viktor Lofgren 2024-02-20 15:45:16 +01:00
parent 904f2587cd
commit 453bd6064b

View File

@ -40,6 +40,11 @@ public class GrpcMultiNodeChannelPool<STUB> {
this.channelConstructor = channelConstructor;
this.stubConstructor = stubConstructor;
this.nodeConfigurationWatcher = nodeConfigurationWatcher;
// Warm up the pool to reduce latency for the initial request
for (var node : nodeConfigurationWatcher.getQueryNodes()) {
apiForNode(node);
}
}