Rxfified version

Wanna use #schedulerx with #reactivex or #mutiny on #vertx…​

Stay tuned, one more step

scheduler.x supports out of the box almost reactive version that officially supports by Vert.x

Dependencies setup

To use scheduler.x API with reactive version, add the following dependency to the dependencies section of your build descriptor:

Maven

In your pom.xml

<dependencies>
    <dependency>
       <groupId>io.vertx</groupId>
       <artifactId>vertx-rx-java3</artifactId>                     (1)
       <version>4.4.4</version>
    </dependency>
    <dependency>
       <groupId>io.smallrye.reactive</groupId>
       <artifactId>smallrye-mutiny-vertx-core</artifactId>         (2)
       <version>{mutiny-version}</version>
    </dependency>
    <dependency>
      <groupId>io.github.zero88</groupId>
      <artifactId>jooqx</artifactId>
      <version>{jooqx-version}</version>
    </dependency>
</dependencies>
1 For using Rx3 version
2 For using mutiny version

Gradle

Gradle (in your build.gradle):

dependencies {
    api 'io.vertx:vertx-core:4.4.4'
    api 'io.github.zero88:schedulerx:2.0.0-rc.1'
    // with rx3
    api 'io.vertx:vertx-rx-java3:4.4.4'                               (1)
    // or with mutiny
    api 'io.smallrye.reactive:smallrye-mutiny-vertx-core:{mutiny-version}'      (2)
    // other your libs...
}
1 For using Rx3 version
2 For using mutiny version

Gradle (in your build.gradle.kts):

dependencies {
  api("io.vertx:vertx-core:4.4.4")
  api("io.github.zero88:schedulerx:2.0.0-rc.1")
  // with rx3
  api("io.vertx:vertx-rx-java3:4.4.4")                                (1)
  // or with mutiny
  api("io.smallrye.reactive:smallrye-mutiny-vertx-core:{mutiny-version}")       (2)
  // other your libs...
}
1 For using Rx3 version
2 For using mutiny version

Well done, now you can enjoy Rxify version with a little effort

Examples

Rx3 - By schedulerx instance

io.github.zero88.schedulerx.IntervalScheduler scheduler
    = io.github.zero88.schedulerx.IntervalScheduler.builder()
                                                   .setVertx(vertx)
                                                   .setTrigger(trigger)
                                                   .setJob(job)
                                                   .build();
// create rx3 schedulerx by non-rxify version
io.github.zero88.schedulerx.rxjava3.IntervalScheduler rxScheduler
    = io.github.zero88.schedulerx.rxjava3.IntervalScheduler.newInstance(scheduler);
rxScheduler.start();

Rx3 - By schedulerx builder

io.vertx.rxjava3.core.Vertx vertxRx3 = io.vertx.rxjava3.core.Vertx.newInstance(vertx);
io.vertx.rxjava3.core.WorkerExecutor workerExecutor = vertxRx3.createSharedWorkerExecutor("hello-rx3");

// Create rx3 schedulerx by builder
io.github.zero88.schedulerx.rxjava3.CronScheduler rxScheduler
    = io.github.zero88.schedulerx.rxjava3.CronScheduler.builder()
                                                       .setVertx(vertxRx3)
                                                       .setTrigger(trigger)
                                                       .setJob(job)
                                                       .build();
// Start scheduler with rx3 worker
rxScheduler.start(workerExecutor);

Mutiny - By schedulerx builder

io.vertx.mutiny.core.Vertx vertxMutiny = io.vertx.mutiny.core.Vertx.newInstance(vertx);
io.vertx.mutiny.core.WorkerExecutor workerExecutor = vertxMutiny.createSharedWorkerExecutor("hello-mutiny");

// Create mutiny schedulerx by builder
io.github.zero88.schedulerx.mutiny.EventScheduler<JsonObject> mutinyScheduler
    = io.github.zero88.schedulerx.mutiny.EventScheduler.<Object, Object, JsonObject>builder()
                                                       .setVertx(vertxMutiny)
                                                       .setTrigger(trigger)
                                                       .setJob(job)
                                                       .build();
// Start scheduler with mutiny worker
mutinyScheduler.start(workerExecutor);