curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsinth <...@git.apache.org>
Subject [GitHub] curator pull request: CURATOR-120 NodeCache and PathChildrenCache ...
Date Fri, 01 Aug 2014 17:45:17 GMT
Github user dragonsinth commented on the pull request:

    https://github.com/apache/curator/pull/16#issuecomment-50913715
  
    Up to you guys.  I don't need it personally anymore, but if you think it would be useful,
I'm happy to do the work to land it.  Let's just decide on what exactly we want.  As I mentioned,
I'm loathe to add more constructor arguments as there are already so many overloads.
    
    What would you think about either a builder, or else a fluent constructor api?
    
    Builder example:
    
    ```
    cache = PathChildrenCache.newBuilder(client, path)
      .ensurePath(false)
      .cacheData(false)
      .compress(true)
      .withExecutor(executor)
      .build()
    cache.start();
    ```
    
    Fluent constructor:
    
    ```
    cache = new PathChildrenCache(client, path)
      .ensurePath(false)
      .cacheData(false)
      .compress(true)
      .withExecutor(executor)
      .start()
    ```
    
    In this formulation, essentially the new PathChildrenCache modifies its configuration
each time, returning itself, which is legal up until start() is called.  Once start() is called
it's illegal state exception to try to call any of the config methods.
    
    Either way, all of the existing defaults would hold for items not specified.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message