Brilliant. Just to confirm for future users: adding
Thread.sleep(500) before each "Pre" fixes it. Bests, S On Thu, Oct 23, 2014 at 8:44 AM, Jordan Zimmerman <[email protected]> wrote: > Updates occur in a different thread. Add a small sleep before > cache.getCurrentData() and the test works as expected. > > -JZ > > > On October 22, 2014 at 11:17:10 PM, Sunil Abraham ([email protected]) > wrote: > > Sorry, was creating a minimal test case and not everything got copied > over. Here's a better example > > https://gist.github.com/sabraham/f987395ff33fdbc8debc > > Stdout: > > foo > Pre: 0 > Post: 1 > Pre: 1 > Post: 2 > > Whereas I would have expected Pre to match Post. > > On Wed, Oct 22, 2014 at 7:17 PM, Jordan Zimmerman > <[email protected]> wrote: >> You’re not starting the cache. You need to call cache.start() >> >> >> On October 22, 2014 at 6:12:23 PM, Sunil Abraham ([email protected]) >> wrote: >> >> Yup, here's a gist: >> >> https://gist.github.com/anonymous/1f7fdab9777e02d91ac1 >> >> On Wed, Oct 22, 2014 at 6:27 PM, Jordan Zimmerman >> <[email protected]> wrote: >>> Can you provide a test that shows the problem? >>> >>> -JZ >>> >>> >>> On October 22, 2014 at 5:24:06 PM, Sunil Abraham ([email protected]) >>> wrote: >>> >>> Hi everyone, >>> >>> I am having difficulty with the the PathChildrenCache; specifically, >>> the local cache, which I am accessing through the getCurrentData >>> method, seems to only to get updated after I call the rebuild method. >>> >>> Does anyone have any thoughts? >>> >>> S
