Re: Modify ZooKeeper Java client to hold weak references to Watcher objects

2010-03-19 Thread Dominic Williams
Hi I can see some people might be assigning for example anonymous class instances as watchers/handlers, and not keeping any references to them. To avoid breaking existing use cases, two options: 1/ Add a useWeakReferences parameter to new constructor (sets default behaviour) 2/ Add alternative m

Re: Modify ZooKeeper Java client to hold weak references to Watcher objects

2010-03-18 Thread Henry Robinson
Yes - the watchers aren't simply relay objects, they typically actually process the callback. Scaling out the watchers in a single client is a laudable aim, but I think this proposal would impact some common use cases. Henry On 18 March 2010 15:47, Ted Dunning wrote: > This kind of sounds stra

Re: Modify ZooKeeper Java client to hold weak references to Watcher objects

2010-03-18 Thread Ted Dunning
This kind of sounds strange to me. My typical idiom is to create a watcher but not retain any references to it outside the client. It sounds to me like your change will cause my watchers to be collected and deactivated when GC happens. On Thu, Mar 18, 2010 at 3:32 AM, Dominic Williams < thedwill