-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from zero88/feature/upgrade-vertx
Feature/upgrade vertx
- Loading branch information
Showing
38 changed files
with
763 additions
and
468 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
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,34 +1,39 @@ | ||
import cloud.playio.gradle.generator.codegen.SourceSetName | ||
|
||
plugins { | ||
`java-test-fixtures` | ||
id(PlayioPlugin.codegen) | ||
} | ||
|
||
|
||
oss { | ||
baseName.set("schedulerx") | ||
title.set("Scheduler.x") | ||
} | ||
val vertxVersion = "4.0.0" | ||
val vertxCore = "io.vertx:vertx-core:${vertxVersion}" | ||
val vertx5Junit = "io.vertx:vertx-junit5:${vertxVersion}" | ||
|
||
codegen { | ||
vertx { | ||
version.set(VertxLibs.Version.defaultVersion) | ||
sources.addAll(arrayOf(SourceSetName.MAIN)) | ||
} | ||
} | ||
|
||
dependencies { | ||
api(vertxCore) | ||
api("org.slf4j:slf4j-api:1.7.30") | ||
api(VertxLibs.core) | ||
compileOnly(JacksonLibs.annotations) | ||
compileOnly(JacksonLibs.databind) | ||
compileOnly(UtilLibs.jetbrainsAnnotations) | ||
annotationProcessor(UtilLibs.jetbrainsAnnotations) | ||
codeGenerator(VertxLibs.rx3) | ||
codeGenerator(MutinyLibs.core) | ||
|
||
testImplementation(vertx5Junit) | ||
testImplementation(TestLibs.junit5Params) | ||
testImplementation(JacksonLibs.databind) | ||
testImplementation("ch.qos.logback:logback-classic:1.2.3") | ||
testImplementation(LogLibs.logback) | ||
testCompileOnly(UtilLibs.jetbrainsAnnotations) | ||
testAnnotationProcessor(UtilLibs.jetbrainsAnnotations) | ||
|
||
testFixturesApi(TestLibs.junit5Api) | ||
testFixturesApi(TestLibs.junit5Engine) | ||
testFixturesApi(TestLibs.junit5Vintage) | ||
testFixturesApi(vertx5Junit) | ||
testFixturesApi(VertxLibs.junit5) | ||
testFixturesCompileOnly(UtilLibs.jetbrainsAnnotations) | ||
testFixturesAnnotationProcessor(UtilLibs.jetbrainsAnnotations) | ||
} |
10 changes: 0 additions & 10 deletions
10
core/src/main/java/io/github/zero88/schedulerx/CronTaskExecutor.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
core/src/main/java/io/github/zero88/schedulerx/IntervalTaskExecutor.java
This file was deleted.
Oops, something went wrong.
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
24 changes: 13 additions & 11 deletions
24
core/src/main/java/io/github/zero88/schedulerx/TaskExecutorLogMonitor.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,47 +1,49 @@ | ||
package io.github.zero88.schedulerx; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.vertx.core.impl.logging.Logger; | ||
import io.vertx.core.impl.logging.LoggerFactory; | ||
|
||
/** | ||
* Represents for log monitor | ||
* Represents for a log monitor that observes and do log on each lifecycle event of the task executor. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public interface TaskExecutorLogMonitor extends TaskExecutorMonitor { | ||
|
||
Logger LOGGER = LoggerFactory.getLogger(TaskExecutorLogMonitor.class); | ||
TaskExecutorMonitor LOG_MONITOR = new TaskExecutorLogMonitor() {}; | ||
TaskExecutorLogMonitor LOG_MONITOR = new TaskExecutorLogMonitor() { }; | ||
|
||
@Override | ||
default void onUnableSchedule(@NotNull TaskResult result) { | ||
LOGGER.error("Unable schedule task at [{}] due to error", result.unscheduledAt(), result.error()); | ||
LOGGER.error("Unable schedule task at [" + result.unscheduledAt() + "] due to error", result.error()); | ||
} | ||
|
||
@Override | ||
default void onSchedule(@NotNull TaskResult result) { | ||
if (result.isReschedule()) { | ||
LOGGER.debug("TaskExecutor is rescheduled at [{}] round [{}]", result.rescheduledAt(), result.round()); | ||
LOGGER.debug( | ||
"TaskExecutor is rescheduled at [" + result.rescheduledAt() + "] round [" + result.round() + "]"); | ||
} else { | ||
LOGGER.debug("TaskExecutor is available at [{}]", result.availableAt()); | ||
LOGGER.debug("TaskExecutor is available at [" + result.availableAt() + "]"); | ||
} | ||
} | ||
|
||
@Override | ||
default void onMisfire(@NotNull TaskResult result) { | ||
LOGGER.debug("Misfire tick [{}] at [{}]", result.tick(), result.triggeredAt()); | ||
LOGGER.debug("Misfire tick [" + result.tick() + "] at [" + result.triggeredAt() + "]"); | ||
} | ||
|
||
@Override | ||
default void onEach(@NotNull TaskResult result) { | ||
LOGGER.debug("Finish round [{}] - Is Error [{}] | Executed at [{}] - Finished at [{}]", result.round(), | ||
result.isError(), result.executedAt(), result.finishedAt()); | ||
LOGGER.debug("Finish round [" + result.round() + "] - Is Error [" + result.isError() + "] | Executed at [" + | ||
result.executedAt() + "] - Finished at [" + result.finishedAt() + "]"); | ||
} | ||
|
||
@Override | ||
default void onCompleted(@NotNull TaskResult result) { | ||
LOGGER.debug("Completed task in round [{}] at [{}]", result.round(), result.completedAt()); | ||
LOGGER.debug("Completed task in round [" + result.round() + "] at [" + result.completedAt() + "]"); | ||
} | ||
|
||
} |
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
53 changes: 53 additions & 0 deletions
53
core/src/main/java/io/github/zero88/schedulerx/TaskExecutorProperties.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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.github.zero88.schedulerx; | ||
|
||
import org.jetbrains.annotations.ApiStatus.Internal; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import io.vertx.codegen.annotations.GenIgnore; | ||
import io.vertx.codegen.annotations.VertxGen; | ||
import io.vertx.core.Vertx; | ||
|
||
/** | ||
* Shared immutable fields between TaskExecutor and its builder | ||
* | ||
* @since 2.0.0 | ||
*/ | ||
@Internal | ||
@VertxGen(concrete = false) | ||
public interface TaskExecutorProperties { | ||
|
||
/** | ||
* Vertx | ||
* | ||
* @return vertx | ||
*/ | ||
@NotNull Vertx vertx(); | ||
|
||
/** | ||
* Defines a task executor monitor | ||
* | ||
* @return task executor monitor | ||
* @see TaskExecutorMonitor | ||
*/ | ||
@GenIgnore(GenIgnore.PERMITTED_TYPE) | ||
@NotNull TaskExecutorMonitor monitor(); | ||
|
||
/** | ||
* Task to execute per round | ||
* | ||
* @return task | ||
* @see Task | ||
*/ | ||
@GenIgnore(GenIgnore.PERMITTED_TYPE) | ||
@NotNull Task task(); | ||
|
||
/** | ||
* Defines job data as input task data | ||
* | ||
* @return job data | ||
* @see JobData | ||
*/ | ||
@GenIgnore(GenIgnore.PERMITTED_TYPE) | ||
@NotNull JobData jobData(); | ||
|
||
} |
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
Oops, something went wrong.