Package com.trendrr.beanstalk

Examples of com.trendrr.beanstalk.BeanstalkClient


  /**
   * Example for using an unpooled client
   * @throws BeanstalkException
   */
  public static void clientExample() throws BeanstalkException {
    BeanstalkClient client = new BeanstalkClient("localhost", 8010, "example");
    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);
    client.deleteJob(job);
    client.close(); //closes the connection
  }
View Full Code Here


    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);
    client.deleteJob(job);
    client.close()//returns the connection to the pool
  }
View Full Code Here

TOP

Related Classes of com.trendrr.beanstalk.BeanstalkClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.