This is a fork of Parallel Universe's Quasar fibers library for Java, updated to work only with Java 9+ without modules.
- Java 9 or higher
Add the plugin to your plugins
block in build.gradle
and include a dependency on this library:
build.gradle
buildscript {
repositories {
// required to help plugin find library
mavenCentral()
}
}
plugins {
id 'java-library'
id 'com.hiddenswitch.fibers.instrument' version '10.0.6'
}
dependencies {
api "com.hiddenswitch:quasar-core:10.0.6"
}
Your code is now instrumented. The fibers
extension supports the following settings:
build.gradle
fibers {
// The Quasar instrumentation includes checks to see if the methods it is entering are instrumented.
check = false
// Prints instrumentation messages.
verbose = false
// Allows Java synchronized blocks to be instrumented.
allowMonitors = false
// Allows suspendable methods to call Java blocking methods.
allowBlocking = false
// Prints debug messaging.
debug = false
// Writes the instrumented classes
writeClasses = true
// Automatically determine which methods should be instrumented based on static analysis.
scanSuspendables = false
// Instrument the interfaces that suspendable methods override.
scanSuspendableSupers = false
}
All compileJava
tasks for all source sets will be instrumented.
- Support for Java 12-16
- Non-AOT support for GraalVM
- Micrometer metrics
- A Gradle plugin
- Support for Java 9-11 (#337, #344, #317)
- A stack size bug (#309)
- vertx-sync fork is now updated (#327)
- Suspendable iterators (#297)
- A time error (#319)
- Package relocation for
asm
to prevent conflicts with other libraries that use it.
- GraalVM's Native Image cannot build instrumented libraries. (Comment on oracle/graal/3759) to get Graal to fix this issue)
actors
: passes tests but unused anywhere in productionmaven-plugin
- How to reference the uninstrumented libraries for building native images using Threads instead of Fibers.
- Kryo-based fiber serialization
disruptor
,galaxy
,kotlin
andreactive-streams
since they are out of scope for being tested by me
How do I edit
gradle-plugin-test
?
In IntelliJ, right click on gradle-plugin-test/build.gradle
and choose Link Gradle Project.