Custom executor service is a cool feature


#1

Hi All!

As I learn more and more about Couchbase -> I’m getting more confident about -> it will be a super handy-dandy NoSql tool for me =D

I had to append our API because of this smart Couchbase feature ->

It is also possible to override the default ExecutorService implementation with a custom one. This may be needed if the default behavior (Basically a upper-bounded cachedThreadPool) does not suite your needs. Also, you should use this approach if you create a bunch of CouchbaseClient instances so you can share the same service across all of them

http://blog.couchbase.com/whats-new-couchbase-java-sdk-12

/** * Returns our executor service instance.

* * Why?!! For example Couchbase supporting to set/use our executor service * instead of -> the default one (in the client driver) ;D * * Factory types newSingleThreadExecutor() newCachedThreadPool() newFixedThreadPool() * newScheduledThreadPool(). * * @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html * * @return the executor service */ public ExecutorService getExecutorService() { return (executorService); }

Sounds interesting -> go ahead and read this blog post:

I’ve used the RDM Server for OLTP very long time -> I’m happy because we have a NATIVE API again!

Thank You Guys :smiley:

ps:

More options sometimes could be useful -> “Ask a question” / “Share a thought”.

Cheers,
Loolek


#2

Sure, on the CouchbaseConnectionFactoryBuilder there is a method where you can pass in your own executor service!


#3

Lol, that’s why I was add this link!!

blog.couchbase.com/whats-new-couchbase-java-sdk-12