Examples of useTube()


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

    }

    // per pashields http://github.com/pashields/JavaBeanstalkClient.git
    // Names cannot start with hyphen
    try {
      client.useTube("-foobar");
      fail("no BAD_FORMAT thrown");
    } catch (BeanstalkException be) {
      assertEquals("BAD_FORMAT", be.getMessage());
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here

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

    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testReserve";

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

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

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

    String srcString = "testReserveWithTimeout";

    int timeoutSeconds = 2;

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

    // consumer
View Full Code Here

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

    Object[] tubeNames = pushWatchedTubes(client);

    String srcString = "testDelete";

    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()

    String srcString = "testReserveWithTimeout";

    int timeoutSeconds = 2;

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

    // not found
    boolean ok = client.release(jobId, 65536, 0);
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.BeanstalkClientImpl.ClientImpl.useTube()

        /* FIXME: There is a problem in JavaBeanstalkClient 1.4.4 (at least in 1.4.4),
           when using uniqueConnectionPerThread=false. The symptom is that ProtocolHandler
           breaks the protocol, reading incomplete messages. To be investigated. */
        //client.setUniqueConnectionPerThread(false);
        client.useTube(tube);
        return client;
    }

    /**
     * Returns the {@link Client} instance for reading operations with all
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.