I want to use spymemcached in our production.
I have some questions:
Question 1:
does spymemcached thread safe? like can I create one instance and use it in multi thread to get/set(I only need to get and set)?
Question 2:
how to know that the ClientConnection is connected or not.
I find that new MemcachedClient will never throw Exception.
this is how I do:
try {
mc = new MemcachedClient( new InetSocketAddress( host, port ) );
mc.get( "test" );
available = true;
} catch( OperationTimeoutException e ) {
available = false;
mc.shutdown();
} catch( ConnectException e ) {
available = false;
mc.shutdown();
} catch( IOException e ) {
available = false;
mc.shutdown();
}
do you have better way????