Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1] Add a RxJava 3 module copied from the RxJava 2 module. #2

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,67 @@
</scm>

<properties>
<version.jakarta.ws.rs-api>2.1.6</version.jakarta.ws.rs-api>
<version.org.jboss.logging>3.4.2.Final</version.org.jboss.logging>
<version.org.jboss.logging.tools>2.2.1.Final</version.org.jboss.logging.tools>
<version.org.jboss.resteasy>5.0.4.Final</version.org.jboss.resteasy>
<version.org.junit>5.8.2</version.org.junit>

<!-- Compile to Java 8 -->
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
</properties>

<modules>
<module>rxjava3</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${version.jakarta.ws.rs-api}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-bom</artifactId>
<version>${version.org.jboss.resteasy}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${version.org.junit}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${version.org.jboss.logging}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<version>${version.org.jboss.logging.tools}</version>
<!-- Only needed at compile time -->
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<version>${version.org.jboss.logging.tools}</version>
<!-- Only needed at compile time -->
<optional>true</optional>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
Expand All @@ -72,4 +125,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
90 changes: 90 additions & 0 deletions rxjava3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~
~ Copyright 2022 Red Hat, Inc., and individual contributors
~ as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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">
<parent>
<artifactId>resteasy-rxjava-parent</artifactId>
<groupId>dev.resteasy.rxjava</groupId>
<version>1.0.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>resteasy-rxjava3</artifactId>

<properties>
<version.io.reactivex.rxjava3-rxjava>3.1.5</version.io.reactivex.rxjava3-rxjava>
</properties>

<dependencies>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>

<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
<version>${version.io.reactivex.rxjava3-rxjava}</version>
</dependency>

<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<!-- Only needed at compile time -->
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<!-- Only needed at compile time -->
<optional>true</optional>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core-spi</artifactId>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-undertow</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
36 changes: 36 additions & 0 deletions rxjava3/src/main/java/dev/resteasy/rxjava3/FlowableProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* JBoss, Home of Professional Open Source.
*
* Copyright 2022 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.resteasy.rxjava3;

import javax.ws.rs.ext.Provider;

import org.jboss.resteasy.spi.AsyncStreamProvider;
import org.reactivestreams.Publisher;

import io.reactivex.rxjava3.core.Flowable;

@Provider
public class FlowableProvider implements AsyncStreamProvider<Flowable<?>> {
@Override
public Publisher<?> toAsyncStream(Flowable<?> asyncResponse) {
return asyncResponse;
}

}
31 changes: 31 additions & 0 deletions rxjava3/src/main/java/dev/resteasy/rxjava3/FlowableRxInvoker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* JBoss, Home of Professional Open Source.
*
* Copyright 2022 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.resteasy.rxjava3;

import javax.ws.rs.client.RxInvoker;

import io.reactivex.rxjava3.core.BackpressureStrategy;
import io.reactivex.rxjava3.core.Flowable;

public interface FlowableRxInvoker extends RxInvoker<Flowable<?>> {
BackpressureStrategy getBackpressureStrategy();

void setBackpressureStrategy(BackpressureStrategy backpressureStrategy);
}
Loading