Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52F3610443 for ; Wed, 10 Dec 2014 14:59:33 +0000 (UTC) Received: (qmail 47360 invoked by uid 500); 10 Dec 2014 14:59:33 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 47315 invoked by uid 500); 10 Dec 2014 14:59:32 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 47304 invoked by uid 99); 10 Dec 2014 14:59:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2014 14:59:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B32C5A23A13; Wed, 10 Dec 2014 14:59:31 +0000 (UTC) From: madrob To: dev@curator.apache.org Reply-To: dev@curator.apache.org References: In-Reply-To: Subject: [GitHub] curator pull request: Added new apis to add additional paths to Ch... Content-Type: text/plain Message-Id: <20141210145931.B32C5A23A13@tyr.zones.apache.org> Date: Wed, 10 Dec 2014 14:59:31 +0000 (UTC) Github user madrob commented on a diff in the pull request: https://github.com/apache/curator/pull/57#discussion_r21607747 --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/ChildReaper.java --- @@ -104,11 +106,11 @@ public ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, Sched public ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, ScheduledExecutorService executor, int reapingThresholdMs, String leaderPath) --- End diff -- Sorry, thought I responded to the builder comment earlier... Adding a proper builder would be great, it would feel more like the rest of the Curator tools then. I'm not sure that being able to chain calls to `add()` does enough though. The use case I have in mind is adding a set of paths to all be reaped. Previously the code would look something like (pseudo-code): for (String path : paths) { new ChildReaper(..., path, ...); } Now the intent is clearly to consolidate on reapers, so the inutitive thing to do would be r = new ChildReaper(); for (String path : paths) { r.addPath(r); } Unfortunately, the constructor requires a path, so either the first path has to be added twice (while it is not apparent from the client perspective that this is safe) or the client has to switch away from a for-each and to a loop that starts on the second element.\ Maybe this can all be sufficiently addressed using javadoc. --- 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. ---