public Builder() { this.pool = new NetworkGearmanWorkerPool(); }
public static void main(String... args) { try { byte data[] = "This is a test".getBytes(); NetworkGearmanWorkerPool workerPool = new NetworkGearmanWorkerPool.Builder() .threads(2) .withConnection(new Connection("localhost", 4730)) .build(); workerPool.registerCallback("reverse", new ReverseFunction()); workerPool.doWork(); } catch (Exception e) { LOG.error("Error: ", e); } } }