Examples of TaskOptions


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

        logger.info("Scheduling blueprint update for delete tasks");
        List<Blueprint> characterBlueprints = blueprintDao.getAll(new Key<User>(User.class, userID), characterID);
        for (Blueprint blueprint : characterBlueprints) {
            logger.info("Scheduling blueprint update for delete task for blueprintID: {}, userID: {}", blueprint.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_BLUEPRINT).param("userID", String.valueOf(userID))
                    .param("blueprintID", String.valueOf(blueprint.getId()));
            queue.add(taskOptions);
        }
    }
View Full Code Here

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

        queue.add();
        queue.add();
        queue.add();
        out.println("<p>Enqueued 3 tasks to the default queue.</p>");

        TaskOptions taskOptions =
            TaskOptions.Builder.withUrl("/send_invitation_task")
            .param("address", "juliet@example.com")
            .param("firstname", "Juliet");
        queue.add(taskOptions);
        out.println("<p>Enqueued 1 task to the default queue with parameters.</p>");
View Full Code Here

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

  private final static String CONN_URL = "/appwrench/queuehandler";
 
  public void addTaskToQueue(Map<String, String> params){
    Queue tq = QueueFactory.getQueue("onPositiveQueue");
    TaskOptions to = TaskOptions.Builder.withUrl(CONN_URL);
    for (String k : params.keySet()) {
      String val = params.get(k);
      to = to.param(k, val);
    }
    to = to.method(Method.POST);
    // to = to.taskName("task" + INIT + "count" + (-1));
    tq.add(to);
  }
View Full Code Here

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

    jobState.getController().completed(tasks);
  }

  private void scheduleControllerTask(Transaction tx, String jobId, String taskId,
      ShardedJobSettings settings) {
    TaskOptions taskOptions = TaskOptions.Builder.withMethod(TaskOptions.Method.POST)
        .url(settings.getControllerPath())
        .param(JOB_ID_PARAM, jobId)
        .param(TASK_ID_PARAM, taskId);
    taskOptions.header("Host", settings.getTaskQueueTarget());
    QueueFactory.getQueue(settings.getQueueName()).add(tx, taskOptions);
  }
View Full Code Here

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

    QueueFactory.getQueue(settings.getQueueName()).add(tx, taskOptions);
  }

  private void scheduleWorkerTask(Transaction tx, ShardedJobSettings settings,
      IncrementalTaskState<T> state, Long eta) {
    TaskOptions taskOptions = TaskOptions.Builder.withMethod(TaskOptions.Method.POST)
        .url(settings.getWorkerPath())
        .param(TASK_ID_PARAM, state.getTaskId())
        .param(JOB_ID_PARAM, state.getJobId())
        .param(SEQUENCE_NUMBER_PARAM, String.valueOf(state.getSequenceNumber()));
    taskOptions.header("Host", settings.getTaskQueueTarget());
    if (eta != null) {
      taskOptions.etaMillis(eta);
    }
    QueueFactory.getQueue(settings.getQueueName()).add(tx, taskOptions);
  }
View Full Code Here

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

  void enqueueProcess(Iterator<String> args, int batchSize, Processor processor) {

    // TODO(pmy): remove finished processes.
    processors.put(processor.name, processor);

    TaskOptions opts = TaskOptions.Builder.withMethod(TaskOptions.Method.POST).url(thisUrl)
        .header("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
        .param(PARAM_PROC_ID, processor.name);

    while (args.hasNext()) {
      for (int i = 0; i < batchSize - 1 && args.hasNext(); i++) {
        opts.param(PARAM_ARGS, args.next());
      }
      queue.add(opts);
      opts.removeParam(PARAM_ARGS);
    }
  }
View Full Code Here

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

    @Override
    public void send(Email email) {
        DeferredTask task = new SendEmailTask(email, transport);

        TaskOptions taskOptions = taskOptionsBuilder.build(task);

        queue.add(taskOptions);
    }
View Full Code Here

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

    }
  }

  @SuppressWarnings("unused")
  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

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

    private NotificationService notificationService = new GMailNotificationServiceImpl();
    private SystemVerifierService systemVerifierService = new SystemVerifierServiceImpl();

    protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
            throws javax.servlet.ServletException, java.io.IOException {
        TaskOptions taskOptions = TaskOptions.Builder.withDefaults();
        taskOptions.url(VERIFY_TASK_URL);
        taskOptions.method(Method.GET);
        taskOptions.countdownMillis(VERIFY_INTERVAL);
        QueueFactory.getDefaultQueue().add(taskOptions);
        this.logger.info("Next verification task scheduled at " + (VERIFY_INTERVAL / 60.0 / 60 / 1000)
                + " hours later.");

        try {
View Full Code Here

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

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
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.