Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.hiddenswitch:vertx-sync:10.0.3'
}
dependencies {
implementation("com.github.hiddenswitch:vertx-sync:10.0.3")
}
<dependency>
<groupId>com.github.hiddenswitch</groupId>
<artifactId>vertx-sync</artifactId>
<version>10.0.3</version>
</dependency>
libraryDependencies += "com.github.hiddenswitch" % "vertx-sync" % "10.0.3"
:dependencies [[com.github.hiddenswitch/vertx-sync "10.0.3"]]
This is a fork of Vertx's Sync library updated for Vertx 4.+, Java 9+ and with instrumentation plugins for Gradle.
Fiber
from java-fibers lets you call async code like vertx
as
though it was synchronous code.
build.gradle
// currently served on jitpack
repositories {
maven { url 'https://jitpack.io' }
}
// enable ahead of time instrumentation of your code
plugins {
id 'com.hiddenswitch.fibers.instrument' version '1.0.4'
}
// configure your instrumentation
fibers {
// shows errors that tell you what code is missing @Suspendable attributes
check = true
}
dependencies {
// include this library, transitively depends on com.hiddenswitch:quasar-core:10.0.3
implementation 'com.github.hiddenswitch:vertx-fibers:master-SNAPSHOT'
// include a version of vertx. tested with the latest 4.x series
implementation 'io.vertx:vertx-core:4.0.0'
}
See a detailed example in ExampleCheckedSyncVerticle.java.
Detailed documentation is coming soon.