-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core,jdbc): small trigger / scheduler improvements
- Loading branch information
1 parent
dc7fef2
commit 3056e9c
Showing
11 changed files
with
40 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
core/src/main/java/io/kestra/core/schedulers/DefaultScheduleContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
package io.kestra.core.schedulers; | ||
|
||
import java.util.function.Consumer; | ||
|
||
// For tests purpose | ||
public class DefaultScheduleContext implements ScheduleContextInterface {} | ||
public class DefaultScheduleContext implements ScheduleContextInterface { | ||
@Override | ||
public void doInTransaction(Consumer<ScheduleContextInterface> consumer) { | ||
consumer.accept(this); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/main/java/io/kestra/core/schedulers/ScheduleContextInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
package io.kestra.core.schedulers; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* This context is used by the Scheduler to allow evaluating and updating triggers in a transaction from the main evaluation loop. | ||
* See AbstractScheduler.handle(). | ||
*/ | ||
public interface ScheduleContextInterface { | ||
/** | ||
* Do trigger retrieval and updating in a single transaction. | ||
*/ | ||
void doInTransaction(Consumer<ScheduleContextInterface> consumer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters