We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give example how to prevent multiple tasks to be executed in parallel. For instance in Java it is:
public static void checkAlreadySubmitted( final TaskInfo currentTaskInfo, final Collection<TaskInfo> allTasks ) { final TaskId currentTaskId = currentTaskInfo.getId(); final String currentTaskName = currentTaskInfo.getName(); final Instant currentTaskStartTime = currentTaskInfo.getStartTime(); final Optional<TaskInfo> priorTask = allTasks.stream() .filter( ti -> !Objects.equals( ti.getId(), currentTaskId ) ) .filter( ti -> currentTaskName.equals( ti.getName() ) ) .filter( ti -> !ti.isDone() ) .filter( ti -> ti.getStartTime().isBefore( currentTaskStartTime ) || ti.getStartTime().equals( currentTaskStartTime ) && ti.getId().toString().compareTo( currentTaskId.toString() ) < 0 ) .findAny(); if ( priorTask.isPresent() ) { throw new IllegalStateException( "Task " + currentTaskName + " [" + priorTask.get().getId() + "] is already submitted" ); } }
Maybe it is implemented in js-utils already and we need to give a reference to it?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Give example how to prevent multiple tasks to be executed in parallel.
For instance in Java it is:
Maybe it is implemented in js-utils already and we need to give a reference to it?
The text was updated successfully, but these errors were encountered: