Package com.surftools.BeanstalkClient

Examples of com.surftools.BeanstalkClient.Client.touch()


    String srcString = "testTouch";
    int timeoutSeconds = 2;

    // nothing to touch
    boolean ok = false;
    ok = client.touch(0);
    assertFalse(ok);

    // producer
    client.useTube((String) tubeNames[1]);
    long jobId = client.put(65536, 0, timeoutSeconds, srcString.getBytes());
View Full Code Here


    client.useTube((String) tubeNames[1]);
    long jobId = client.put(65536, 0, timeoutSeconds, srcString.getBytes());
    assertTrue(jobId > 0);

    // we haven't reserved, so we can't touch
    ok = client.touch(jobId);
    assertFalse(ok);

    // reserve the job
    Job job = client.reserve(null);
    assertNotNull(job);
View Full Code Here

      job = client.reserve(2 * timeoutSeconds);
      fail("expected DEADLINE_SOON");
    } catch (BeanstalkException be) {
      String message = be.getMessage();
      assertEquals("DEADLINE_SOON", message);
      ok = client.touch(jobId);
      assertTrue(ok);
    } catch (Exception e) {
      fail("caught exception: " + e.getMessage());
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.