Example #1
0
  /**
   * when requesting a confirmation to the task master we anyhow allocate temporary the resources
   *
   * @param t task to be confirmed
   */
  private void getConfirm(TaskPlaceholder.Deferred t) {
    // here we temporary block resources
    // and ask for confirmation
    borrowers.lend(t.taskMaster, t.required);
    waitingConfirmation.put(t.getId(), t);

    trigger(new Resources.Confirm(t), workerPort);
  }
Example #2
0
  private void allocateDirectly(TaskPlaceholder.Direct placeholder) {
    // here we allocate resources and start the timers
    borrowers.lend(placeholder.taskMaster, placeholder.task.required);

    res.workingQueue.running.put(placeholder.getId(), placeholder);

    log.info("{} Allocated {}", getId(), placeholder.getId());

    runTask(placeholder.task);
  }