You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by GitBox <gi...@apache.org> on 2020/01/27 21:35:53 UTC

[GitHub] [curator] shayshim commented on a change in pull request #343: [CURATOR-557] ServiceCacheImpl does not close ExecutorService

shayshim commented on a change in pull request #343: [CURATOR-557] ServiceCacheImpl does not close ExecutorService
URL: https://github.com/apache/curator/pull/343#discussion_r371474832
 
 

 ##########
 File path: curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceProviderImpl.java
 ##########
 @@ -43,13 +46,21 @@
     private final ProviderStrategy<T> providerStrategy;
     private final DownInstanceManager<T> downInstanceManager;
 
-    public ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery, String serviceName, ProviderStrategy<T> providerStrategy, ThreadFactory threadFactory, List<InstanceFilter<T>> filters, DownInstancePolicy downInstancePolicy)
+    public ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery, String serviceName, ProviderStrategy<T> providerStrategy, ThreadFactory threadFactory, CloseableExecutorService executorService, List<InstanceFilter<T>> filters, DownInstancePolicy downInstancePolicy)
 
 Review comment:
   This constructor is `public` (can be used directly, skipping `ServiceProviderBuilder`), and now it accepts both `ThreadFactory` and `CloseableExecutorService`, which can be confusing. 
   I suggest to make this constructor package-private and add 2 `public` constructors: one that accepts all arguments as this one but only `ThreadFactory` (no `CloseableExecutorService`) and second that accepts all arguments as this one but only `CloseableExecutorService` (no `ThreadFactory`). Both will delegate to this constructor (with `null` as the missing argument).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services