Examples of useTube()


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

    } catch (Exception e) {
      fail("caught unexpected exception: " + e.getClass().getCanonicalName() + ", " + e.getMessage());
    }

    try {
      client.useTube(null);
      fail("didn't throw");
    } catch (BeanstalkException be) {
      assertEquals("null tubeName", be.getMessage());
    } catch (Exception e) {
      fail("caught unexpected exception: " + e.getClass().getCanonicalName() + ", " + e.getMessage());
View Full Code Here

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

  public void testPutPerformance() {
    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    byte[] bytes = "testPutPerformance".getBytes();
    int nIterations = 10;
    long sumMillis = 0;
View Full Code Here

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

  public void testPauseTube() {

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    String srcString = "testPauseTube";
    int delaySeconds = 0;
    int tubeDelay = 3;
View Full Code Here

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

    String srcString = "testPauseTube";
    int delaySeconds = 0;
    int tubeDelay = 3;

    // producer
    client.useTube((String) tubeNames[1]);
    // now pause the tube
    client.pauseTube((String) tubeNames[1], tubeDelay);

    // note we adjust delay
    long jobId = client.put(65536, delaySeconds, 120, srcString.getBytes());
View Full Code Here

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

    boolean ok = false;
    ok = client.bury(0, 65536);
    assertFalse(ok);

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

    // we haven't reserved, so we can't bury
    ok = client.bury(jobId, 65536);
View Full Code Here

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

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

    // producer
    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);
View Full Code Here

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

    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testStatsTube";

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

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

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

    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testStatsJob";

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

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

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

  public void testPeek() {

    Client client = new ClientImpl(TEST_HOST, TEST_PORT);

    Object[] tubeNames = pushWatchedTubes(client);
    client.useTube((String) tubeNames[1]);

    Job job = client.peek(-1);
    assertNull(job);
    job = client.peek(0);
    assertNull(job);
View Full Code Here

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

    int nJobs = 3;
    long[] jobIds = new long[nJobs];

    // producer
    for (int i = 0; i < nJobs; ++i) {
      client.useTube((String) tubeNames[1]);
      long jobId = client.put(65536, 0, 120, (srcString + i).getBytes());
      assertTrue(jobId > 0);
      jobIds[i] = jobId;
    }
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.