Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-RC7'
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegDokuka committed Apr 27, 2020
2 parents 83d97f7 + a5706bf commit f1c3198
Show file tree
Hide file tree
Showing 191 changed files with 8,397 additions and 4,933 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ matrix:
- jdk: openjdk8
- jdk: openjdk11
env: SKIP_RELEASE=true
- jdk: openjdk13
- jdk: openjdk14
env: SKIP_RELEASE=true

env:
Expand Down
50 changes: 32 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@ Releases are available via Maven Central.
Example:

```groovy
repositories {
mavenCentral()
}
dependencies {
implementation 'io.rsocket:rsocket-core:1.0.0-RC6'
implementation 'io.rsocket:rsocket-transport-netty:1.0.0-RC6'
}
```

Snapshots are available via [oss.jfrog.org](oss.jfrog.org) (OJO).

Example:

```groovy
repositories {
maven { url 'https://oss.jfrog.org/oss-snapshot-local' }
}
dependencies {
implementation 'io.rsocket:rsocket-core:1.0.0-RC3'
implementation 'io.rsocket:rsocket-transport-netty:1.0.0-RC3'
// implementation 'io.rsocket:rsocket-core:1.0.0-RC4-SNAPSHOT'
// implementation 'io.rsocket:rsocket-transport-netty:1.0.0-RC4-SNAPSHOT'
implementation 'io.rsocket:rsocket-core:1.0.0-RC7-SNAPSHOT'
implementation 'io.rsocket:rsocket-transport-netty:1.0.0-RC7-SNAPSHOT'
}
```

Expand Down Expand Up @@ -57,7 +72,7 @@ package io.rsocket.transport.netty;

import io.rsocket.Payload;
import io.rsocket.RSocket;
import io.rsocket.RSocketFactory;
import io.rsocket.core.RSocketConnector;
import io.rsocket.transport.netty.client.WebsocketClientTransport;
import io.rsocket.util.DefaultPayload;
import reactor.core.publisher.Flux;
Expand All @@ -67,14 +82,14 @@ import java.net.URI;
public class ExampleClient {
public static void main(String[] args) {
WebsocketClientTransport ws = WebsocketClientTransport.create(URI.create("ws://rsocket-demo.herokuapp.com/ws"));
RSocket client = RSocketFactory.connect().keepAlive().transport(ws).start().block();
RSocket clientRSocket = RSocketConnector.connectWith(ws).block();

try {
Flux<Payload> s = client.requestStream(DefaultPayload.create("peace"));
Flux<Payload> s = clientRSocket.requestStream(DefaultPayload.create("peace"));

s.take(10).doOnNext(p -> System.out.println(p.getDataUtf8())).blockLast();
} finally {
client.dispose();
clientRSocket.dispose();
}
}
}
Expand All @@ -89,25 +104,24 @@ or you will get a memory leak. Used correctly this will reduce latency and incre

### Example Server setup
```java
RSocketFactory.receive()
RSocketServer.create(new PingHandler())
// Enable Zero Copy
.frameDecoder(PayloadDecoder.ZERO_COPY)
.acceptor(new PingHandler())
.transport(TcpServerTransport.create(7878))
.start()
.payloadDecoder(PayloadDecoder.ZERO_COPY)
.bind(TcpServerTransport.create(7878))
.block()
.onClose()
.block();
```

### Example Client setup
```java
Mono<RSocket> client =
RSocketFactory.connect()
RSocket clientRSocket =
RSocketConnector.create()
// Enable Zero Copy
.frameDecoder(PayloadDecoder.ZERO_COPY)
.transport(TcpClientTransport.create(7878))
.start();
.payloadDecoder(PayloadDecoder.ZERO_COPY)
.connect(TcpClientTransport.create(7878))
.start()
.block();
```

## Bugs and Feedback
Expand Down
65 changes: 56 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 the original author or authors.
* Copyright 2015-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,12 +26,12 @@ plugins {
subprojects {
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.github.sherter.google-java-format'
ext['reactor-bom.version'] = 'Dysprosium-RELEASE'

ext['reactor-bom.version'] = 'Dysprosium-SR7'
ext['logback.version'] = '1.2.3'
ext['findbugs.version'] = '3.0.2'
ext['netty-bom.version'] = '4.1.37.Final'
ext['netty-boringssl.version'] = '2.0.25.Final'
ext['netty-bom.version'] = '4.1.48.Final'
ext['netty-boringssl.version'] = '2.0.30.Final'
ext['hdrhistogram.version'] = '2.1.10'
ext['mockito.version'] = '3.2.0'
ext['slf4j.version'] = '1.7.25'
Expand Down Expand Up @@ -88,11 +88,18 @@ subprojects {
repositories {
mavenCentral()

if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) {
if (version.endsWith('SNAPSHOT') || project.hasProperty('platformVersion')) {
maven { url 'http://repo.spring.io/libs-snapshot' }
maven {
url 'https://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}
}

tasks.withType(GenerateModuleMetadata) {
enabled = false
}

plugins.withType(JavaPlugin) {
compileJava {
sourceCompatibility = 1.8
Expand All @@ -102,21 +109,61 @@ subprojects {
}

javadoc {
def jdk = JavaVersion.current().majorVersion
def jdkJavadoc = "https://docs.oracle.com/javase/$jdk/docs/api/"
if (JavaVersion.current().isJava11Compatible()) {
jdkJavadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/"
}
options.with {
links 'https://docs.oracle.com/javase/8/docs/api/'
links jdkJavadoc
links 'https://projectreactor.io/docs/core/release/api/'
links 'https://netty.io/4.1/api/'
}
}

tasks.named("javadoc").configure {
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
}

test {
useJUnitPlatform()

systemProperty "io.netty.leakDetection.level", "ADVANCED"
}

tasks.named("javadoc").configure {
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
//all test tasks will show FAILED for each test method,
// common exclusions, no scanning
project.tasks.withType(Test).all {
testLogging {
events "FAILED"
showExceptions true
exceptionFormat "FULL"
stackTraceFilters "ENTRY_POINT"
maxGranularity 3
}

if (JavaVersion.current().isJava9Compatible()) {
println "Java 9+: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}"
jvmArgs = ["-XX:MaxGCPauseMillis=20"]
}

systemProperty("java.awt.headless", "true")
systemProperty("reactor.trace.cancel", "true")
systemProperty("reactor.trace.nocapacity", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
scanForTestClasses = false
exclude '**/*Abstract*.*'

//allow re-run of failed tests only without special test tasks failing
// because the filter is too restrictive
filter.setFailOnNoMatchingTests(false)

//display intermediate results for special test tasks
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println('\n' + "${desc} Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)")
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
version=1.0.0-RC6
perfBaselineVersion=1.0.0-RC5
version=1.0.0-RC7
perfBaselineVersion=1.0.0-RC6
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 9 additions & 5 deletions rsocket-core/src/main/java/io/rsocket/Closeable.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@

package io.rsocket;

import org.reactivestreams.Subscriber;
import reactor.core.Disposable;
import reactor.core.publisher.Mono;

/** */
/** An interface which allows listening to when a specific instance of this interface is closed */
public interface Closeable extends Disposable {
/**
* Returns a {@code Publisher} that completes when this {@code RSocket} is closed. A {@code
* RSocket} can be closed by explicitly calling {@link RSocket#dispose()} or when the underlying
* transport connection is closed.
* Returns a {@link Mono} that terminates when the instance is terminated by any reason. Note, in
* case of error termination, the cause of error will be propagated as an error signal through
* {@link org.reactivestreams.Subscriber#onError(Throwable)}. Otherwise, {@link
* Subscriber#onComplete()} will be called.
*
* @return A {@code Publisher} that completes when this {@code RSocket} close is complete.
* @return a {@link Mono} to track completion with success or error of the underlying resource.
* When the underlying resource is an `RSocket`, the {@code Mono} exposes stream 0 (i.e.
* connection level) errors.
*/
Mono<Void> onClose();
}
Loading

0 comments on commit f1c3198

Please sign in to comment.