Package com.google.appengine.api.taskqueue

Examples of com.google.appengine.api.taskqueue.Queue


          }
        }
      }
    };
    String queueName = Optional.fromNullable(getOnQueue()).or("default");
    Queue queue = QueueFactory.getQueue(queueName);
    queue.add(TaskOptions.Builder.withPayload(pollTask)
        .countdownMillis(10000).retryOptions(RetryOptions.Builder.withMinBackoffSeconds(
            BigQueryConstants.MIN_TIME_BEFORE_NEXT_POLL).maxBackoffSeconds(
            BigQueryConstants.MAX_TIME_BEFORE_NEXT_POLL)));
    return null;
  }
View Full Code Here


          // Already done
        }
      }
    };
    String queueName = Optional.fromNullable(getOnQueue()).or("default");
    Queue queue = QueueFactory.getQueue(queueName);
    queue.add(TaskOptions.Builder.withPayload(deleteRecordsTask).countdownMillis(10000)
        .retryOptions(RetryOptions.Builder.withMinBackoffSeconds(2).maxBackoffSeconds(20)));
    return null;
  }
View Full Code Here

  private static String checkQueueSettings(String queueName) {
    if (queueName == null) {
      return null;
    }
    final Queue queue = QueueFactory.getQueue(queueName);
    try {
      runWithRetries(new Callable<Void>() {
        @Override public Void call() {
          // Does not work as advertise (just check that the queue name is valid).
          // See b/13910616. Probably after the bug is fixed the check would need
          // to inspect EnforceRate for not null.
          queue.fetchStatistics();
          return null;
        }
      }, QUEUE_RETRY_PARAMS, QUEUE_EXCEPTION_HANDLER);
    } catch (RetryHelperException ex) {
      if (ex.getCause() instanceof IllegalStateException) {
View Full Code Here

            if (keysToFetch.size() > 999) {
                Map<Key<Object>, Object> map = objectify.get(keysToFetch);
                objectify.put(map.values());

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/reindex").method(TaskOptions.Method.POST)
                        .param("entityClass", entityClass)
                        .param("dumpVersion", dumpVersion)
                        .param("bookmark", newBookmark));
                logger.info("1000 objects processed, created new task with url: entityClass={}, dumpVersion={}, bookmark: {}", new Object[]{entityClass, dumpVersion, newBookmark});
                resp.getWriter().write("IN PROGRESS");
View Full Code Here

                    blueprintDetailsList.add(blueprintDetailsCalculationService.getBlueprintDetailsForTypeID(invBlueprintType.getBlueprintTypeID()));
                }
                objectify.put(blueprintDetailsList);

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/calculateBlueprintDetails").method(TaskOptions.Method.POST)
                        .param("bookmark", newBookmark));
                logger.info("20 objects processed, created new task with url: bookmark: {}", newBookmark);
                resp.getWriter().write("IN PROGRESS");
                return;
            }
View Full Code Here

                    populateTokens(invType);
                }
                objectify.put(map.values());

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/tokenizeInvType").method(TaskOptions.Method.POST)
                        .param("dumpVersion", dumpVersion)
                        .param("bookmark", newBookmark));
                logger.info("1000 objects processed, created new task with url: dumpVersion={}, bookmark: {}", new Object[]{dumpVersion, newBookmark});
                resp.getWriter().write("IN PROGRESS");
                return;
View Full Code Here

  private void enqueueNewSearch(SearchNTT currentSearch) {
    TaskOptions taskoptions = TaskOptions.Builder
        .withUrl("/search_n_store_by_tag")
        .param(CURRENT_SEARCH, "" + currentSearch.getId())
        .method(TaskOptions.Method.GET);
    Queue queue = QueueFactory.getQueue(SEARCH_QUEUE);
    queue.add(taskoptions);
  }
View Full Code Here

          url = service.getAgentUrl(agentId);
        }
       
        URL uri = new URL(url);
        String path = uri.getPath();   
        Queue queue = QueueFactory.getDefaultQueue();
        TaskHandle task = queue.add(withUrl(path)
            .payload(request.toString())
            .countdownMillis(delay));
       
        // store task information
        DateTime timestamp = DateTime.now().plus(delay);
View Full Code Here

     * @param taskId
     */
    @Override
    public void cancelTask(String id) {
      // stop the task
      Queue queue = QueueFactory.getDefaultQueue();
      queue.deleteTask(id);
     
      // remove stored task
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      GaeTask storedTask = datastore.load(GaeTask.class, id);
      if (storedTask != null) {
View Full Code Here

public class Mail implements DeferredTask {
    public static void send(Email email) {
        DeferredTask task = new Mail(email);
       
        TaskOptions taskOptions = TaskOptions.Builder.withPayload(task);
        Queue queue = QueueFactory.getDefaultQueue();
        queue.add(taskOptions);
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.taskqueue.Queue

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.