Closed GoogleCodeExporter closed 9 years ago
You can do most of what you want with a connection observer. I do that in the
test
case for it here:
http://github.com/dustin/java-memcached-client/blob/master/src/test/java/net/spy
/memcached/ObserverTest.java#L28
It's a bit more complicated, but this allows you to do two things:
1. Send off alerts on the exact connects and disconnects you're interested in.
2. Use a latch to wait for connections to come up during initialization code
and fail
if enough connections don't come up within enough time.
For example, if you were bringing up 100 connections, you might consider your
application successfully initialized at the point where 75 of them come up.
With a
countdown latch counting down from 75, at the point where the latch releases,
you're
good. If you get a timeout before the latch releases, you'll get a timeout
exception
and can decide to fail and shut down.
I'm going to mark this as invalid because I do think it's possible to do what
you
want currently.
Original comment by dsalli...@gmail.com
on 31 Oct 2009 at 7:58
Original issue reported on code.google.com by
dwitherspoon3
on 30 Oct 2009 at 6:35