Examples of leaseTasksAsync()


Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

    }

    @Test(expected = InvalidQueueModeException.class)
    public void testLeaseFromNonPullQueue() {
        Queue remoteQueue = QueueFactory.getQueue(E2E_TESTING_REMOTE);
        waitOnFuture(remoteQueue.leaseTasksAsync(1, TimeUnit.MILLISECONDS, 1));
    }

    @Test(expected = IllegalStateException.class)
    public void testLeaseNonExistQueue() {
        Queue nonExistQueue = QueueFactory.getQueue("nonExistQueue");
View Full Code Here

Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

    }

    @Test(expected = IllegalStateException.class)
    public void testLeaseNonExistQueue() {
        Queue nonExistQueue = QueueFactory.getQueue("nonExistQueue");
        waitOnFuture(nonExistQueue.leaseTasksAsync(1, TimeUnit.MILLISECONDS, 1));
    }

    @Test(expected = IllegalStateException.class)
    public void testDeleteNonExist() {
        Queue nonExistQueue = QueueFactory.getQueue("nonExistQueue");
View Full Code Here

Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

    @Test
    public void testPullParams() throws Exception {
        final Queue queue = QueueFactory.getQueue("pull-queue");
        TaskHandle th = queue.add(withMethod(PULL).param("foo", "bar").etaMillis(15000));
        try {
            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(30, TimeUnit.MINUTES, 100));
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

    @Test
    public void testPullPayload() throws Exception {
        final Queue queue = QueueFactory.getQueue("pull-queue");
        TaskHandle th = queue.add(withMethod(PULL).payload("foobar").etaMillis(15000));
        try {
            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(30, TimeUnit.MINUTES, 100));
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

        try {
            LeaseOptions options = new LeaseOptions(LeaseOptions.Builder
                .withLeasePeriod(1000L, TimeUnit.SECONDS))
                .countLimit(100)
                .groupByTag();
            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(options));
            assertEquals(2, handles.size());

            Set<String> expectedTasks = taskHandlesToNameSet(th1, th3);
            Set<String> returnedTasks = taskHandleListToNameSet(handles);
            assertEquals(expectedTasks, returnedTasks);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.Queue.leaseTasksAsync()

        TaskHandle th1 = queue.add(withMethod(PULL));
        TaskHandle th2 = queue.add(withMethod(PULL));
        sync(2000);
        try {
            int countLimit = 1;
            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(10, TimeUnit.SECONDS, countLimit));
            assertEquals(countLimit, handles.size());
        } finally {
            queue.deleteTask(th1);
            queue.deleteTask(th2);
        }
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.