I have some scheduled task:
@Component
class Task {
@Scheduled(...)
void exec() {
doSmth();
if (allDone) {
// cancel task, it wont ever run again
}
}
}
This is how I want this to look like. There are solutions on web, but they all seems to be rather complex and not quite work for me, while it seems to be rather common problem.