Merge pull request #8928 from w0wka91/BAEL-2398-couroutines-in-java

Bael 2398 couroutines in java
This commit is contained in:
Greg 2020-04-04 20:05:12 -04:00 committed by GitHub
commit 95a4beda32
4 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,84 @@
<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>
<artifactId>coroutines-with-quasar</artifactId>
<name>coroutines-with-quasar</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>libraries-concurrency</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<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.quasar.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.quasar.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>

View File

@ -0,0 +1,11 @@
package com.baeldung.quasar;
import co.paralleluniverse.fibers.Fiber;
public class App {
public static void main(String[] args) {
new Fiber<Void>(() -> {
System.out.println("Inside fiber coroutine...");
}).start();
}
}

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<artifactId>libraries-concurrency</artifactId>
<name>libraries-concurrency</name>
<packaging>pom</packaging>
<parent>
<artifactId>parent-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modules>
<module>coroutines-with-quasar</module>
</modules>
</project>

View File

@ -1263,6 +1263,7 @@
<module>wildfly</module>
<module>xml</module>
<module>xstream</module>
<module>libraries-concurrency</module>
</modules>
</profile>