BAEL-2398 add example
This commit is contained in:
parent
fe61b54e0e
commit
0876b7fdc8
|
@ -0,0 +1,89 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>coroutines-java</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<name>coroutines-java</name>
|
||||
<url>http://baeldung.com</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>co.paralleluniverse</groupId>
|
||||
<artifactId>quasar-core</artifactId>
|
||||
<version>0.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.paralleluniverse</groupId>
|
||||
<artifactId>quasar-actors</artifactId>
|
||||
<version>0.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.paralleluniverse</groupId>
|
||||
<artifactId>quasar-reactive-streams</artifactId>
|
||||
<version>0.8.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>getClasspathFilenames</id>
|
||||
<goals>
|
||||
<goal>properties</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<configuration>
|
||||
<mainClass>com.baeldung.App</mainClass>
|
||||
<workingDirectory>target/classes</workingDirectory>
|
||||
<executable>java</executable>
|
||||
<arguments>
|
||||
<!-- Turn off before production -->
|
||||
<argument>-Dco.paralleluniverse.fibers.verifyInstrumentation=true</argument>
|
||||
|
||||
<!-- Quasar Agent -->
|
||||
<argument>-javaagent:${co.paralleluniverse:quasar-core:jar}</argument>
|
||||
|
||||
<!-- Classpath -->
|
||||
<argument>-classpath</argument>
|
||||
<classpath />
|
||||
|
||||
<!-- Main class -->
|
||||
<argument>com.baeldung.App</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>12</source>
|
||||
<target>12</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,11 @@
|
|||
package com.baeldung;
|
||||
|
||||
import co.paralleluniverse.fibers.Fiber;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
new Fiber<Void>(() -> {
|
||||
System.out.println("Inside fiber coroutine...");
|
||||
}).start();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue