Skip to content

Instantly share code, notes, and snippets.

@ingenthr
Created February 8, 2012 01:12
Show Gist options
  • Save ingenthr/1763980 to your computer and use it in GitHub Desktop.
Save ingenthr/1763980 to your computer and use it in GitHub Desktop.
example of capping input queue and blocking with timeout
List<URI> baselist = new ArrayList<URI>();
baselist.add(new URI("http://localhost:8091/pools"));
CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
cfb.setOpTimeout(10000); // wait up to 10 seconds for an operation to succeed
cfb.setOpQueueMaxBlockTime(5000); // wait up to 5 seconds when trying to enqueue an operation
CouchbaseClient myclient = new CouchbaseClient(cfb.buildCouchbaseConnection(baselist, "default", "default", ""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment