client.close(); //closes the connection
}
public static void pooledExample() throws BeanstalkException {
BeanstalkPool pool = new BeanstalkPool("localhost", 8010,
30, //poolsize
"example" //tube to use
);
BeanstalkClient client = pool.getClient();
log.info("Putting a job");
client.put(1l, 0, 5000, "this is some data".getBytes());
BeanstalkJob job = client.reserve(60);
log.info("GOt job: " + job);