├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle ├── doc.gradle ├── ide.gradle ├── setup.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src ├── api ├── overview.html └── stylesheet.css ├── docbook ├── css │ ├── highlight.css │ ├── manual-multipage.css │ ├── manual-singlepage.css │ └── manual.css ├── images │ ├── background.png │ ├── caution.png │ ├── important.png │ ├── logo.png │ ├── note.png │ ├── tip.png │ └── warning.png └── xsl │ ├── common.xsl │ ├── epub.xsl │ ├── html-multipage.xsl │ ├── html-singlepage.xsl │ ├── html.xsl │ ├── pdf.xsl │ ├── xslthl-config.xml │ └── xslthl │ ├── asciidoc-hl.xml │ ├── bourne-hl.xml │ ├── c-hl.xml │ ├── cpp-hl.xml │ ├── csharp-hl.xml │ ├── css-hl.xml │ ├── html-hl.xml │ ├── ini-hl.xml │ ├── java-hl.xml │ ├── javascript-hl.xml │ ├── json-hl.xml │ ├── perl-hl.xml │ ├── php-hl.xml │ ├── properties-hl.xml │ ├── python-hl.xml │ ├── ruby-hl.xml │ ├── sql2003-hl.xml │ └── yaml-hl.xml ├── docs └── asciidoc │ ├── 20to21.adoc │ ├── aeron.adoc │ ├── core-bytebuffer.adoc │ ├── gettingstarted.adoc │ ├── images │ ├── RBP.png │ ├── RBWP.png │ ├── broadcast.png │ ├── bus-overview.png │ ├── core-overview.png │ ├── golo │ │ ├── body-bg.png │ │ └── pre-bg.png │ ├── logo-2x.png │ ├── logo.png │ ├── longMaxThreading.png │ ├── maker │ │ └── body-bg.png │ ├── marble │ │ ├── marble-101.png │ │ ├── marble-overflowbuffer.png │ │ ├── marble-overflowdrop.png │ │ ├── marble-requestwhen.png │ │ └── marble-throttle.png │ ├── modules.png │ ├── nThreading.png │ ├── net-latency.png │ ├── net-overview.png │ ├── overview.png │ ├── rbd2.png │ ├── rs.png │ ├── signals.png │ ├── streams-overview.png │ └── wiringup.png │ ├── index-docinfo.html │ ├── index-docinfo.xml │ ├── index.asciidoc │ ├── kafka.adoc │ ├── nav.html │ ├── net-e2e.adoc │ ├── net-http.adoc │ ├── net-tcp.adoc │ ├── net.adoc │ └── stylesheets │ ├── asciidoctor.css │ ├── colony.css │ ├── foundation-lime.css │ ├── foundation-potion.css │ ├── foundation.css │ ├── github.css │ ├── golo.css │ ├── iconic.css │ ├── maker.css │ ├── readthedocs.css │ ├── rocket-panda.css │ └── rubygems.css ├── main └── java │ └── reactor │ └── ipc │ ├── connector │ ├── Connector.java │ ├── Inbound.java │ ├── Outbound.java │ └── OutboundThen.java │ └── stream │ ├── Ipc.java │ ├── IpcDone.java │ ├── IpcInit.java │ ├── IpcServiceMapper.java │ ├── OnStream.java │ ├── SimpleStreamConnector.java │ ├── StreamConnector.java │ ├── StreamContext.java │ ├── StreamContextImpl.java │ ├── StreamOperations.java │ ├── StreamOperationsImpl.java │ ├── StreamOutbound.java │ └── StreamSetup.java └── test ├── java └── reactor │ └── ipc │ ├── BasicPingPongTests.java │ └── socket │ ├── ByteArrayStreamProtocol.java │ ├── SimpleClient.java │ ├── SimpleConnection.java │ ├── SimpleContext.java │ ├── SimplePeer.java │ └── SimpleServer.java └── resources └── logback.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | .#* 3 | .DS_Store 4 | bin 5 | build 6 | .classpath 7 | .eclipse 8 | .gradle 9 | .project 10 | .settings 11 | out 12 | *.log 13 | *.i* 14 | *.java.hsp 15 | *.index 16 | *.data 17 | classes 18 | exportToHtml 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | 5 | sudo: required 6 | 7 | cache: 8 | directories: 9 | - $HOME/.m2 10 | - $HOME/.gradle -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # reactor-ipc is no longer actively maintained by VMware, Inc. 2 | 3 | > :warning: **Note**: This project is has been phased out 4 | in Reactor 3.x and is only used in the non supported reactor-netty versions 0.5 and 0.6. 5 | 6 | If you have questions about Reactor 3, join the 7 | community (see the [reactor README](https://github.com/reactor/reactor/blob/master/README.md)). 8 | 9 | 10 | [](https://gitter.im/reactor/reactor?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 11 | 12 | # reactor-ipc 13 | 14 | You will find backpressure-ready components to encode, decode, send (unicast, multicast or request/response) and serve connections in dedicated repositories : 15 | - [reactor-netty](https://github.com/reactor/reactor-netty) : Client/Server interactions for UDP/TCP/HTTP 16 | - [reactor-kafka](https://github.com/reactor/reactor-kafka) : Reactive Kafka client 17 | 18 | ## Javadoc 19 | http://projectreactor.io/docs/ipc/release/api/ 20 | 21 | _Licensed under [Apache Software License 2.0](www.apache.org/licenses/LICENSE-2.0)_ 22 | 23 | _Sponsored by [Pivotal](http://pivotal.io)_ 24 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2017 Pivotal Software Inc, All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | buildscript { 18 | repositories { 19 | maven { url "https://repo.spring.io/plugins-release" } 20 | } 21 | dependencies { 22 | classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7', 23 | 'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE', 24 | 'com.github.jengelman.gradle.plugins:shadow:1.2.0', 25 | 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.8' 26 | } 27 | } 28 | 29 | plugins { 30 | id 'org.asciidoctor.convert' version '1.5.2' 31 | } 32 | 33 | description = 'IPC contracts for Reactive transport and protocol' 34 | 35 | ext { 36 | gradleVersion = '3.5' 37 | gradleScriptDir = "${rootProject.projectDir}/gradle" 38 | 39 | reactorVersion = '3.1.0.BUILD-SNAPSHOT' 40 | 41 | // Logging 42 | slf4jVersion = '1.7.12' 43 | logbackVersion = '1.1.2' 44 | 45 | javadocLinks = [ 46 | "https://docs.oracle.com/javase/7/docs/api/", 47 | "https://docs.oracle.com/javaee/6/api/", 48 | "https://fasterxml.github.io/jackson-databind/javadoc/2.5/", 49 | "https://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/", 50 | "https://projectreactor.io/docs/core/release/api/", 51 | "https://projectreactor.io/docs/netty/release/api/", 52 | ] as String[] 53 | } 54 | 55 | apply from: "$gradleScriptDir/setup.gradle" 56 | apply from: "$gradleScriptDir/doc.gradle" 57 | 58 | configure(rootProject) { project -> 59 | group = 'io.projectreactor.ipc' 60 | 61 | apply plugin: 'propdeps' 62 | apply plugin: 'java' 63 | apply from: "${gradleScriptDir}/ide.gradle" 64 | 65 | [compileJava, compileTestJava]*.options*.compilerArgs = [ 66 | "-Xlint:varargs", 67 | "-Xlint:cast", 68 | "-Xlint:classfile", 69 | "-Xlint:dep-ann", 70 | "-Xlint:divzero", 71 | "-Xlint:empty", 72 | "-Xlint:finally", 73 | "-Xlint:overrides", 74 | "-Xlint:path", 75 | "-Xlint:processing", 76 | "-Xlint:static", 77 | "-Xlint:try", 78 | "-Xlint:deprecation", 79 | "-Xlint:unchecked", 80 | "-Xlint:-serial", // intentionally disabled 81 | "-Xlint:-options", // intentionally disabled 82 | "-Xlint:-fallthrough", // intentionally disabled 83 | "-Xlint:-rawtypes" // TODO enable and fix warnings 84 | ] 85 | 86 | compileJava { 87 | sourceCompatibility = 1.8 88 | targetCompatibility = 1.8 89 | } 90 | 91 | compileTestJava { 92 | sourceCompatibility = 1.8 93 | targetCompatibility = 1.8 94 | } 95 | 96 | if (JavaVersion.current().isJava8Compatible()) { 97 | compileTestJava.options.compilerArgs += "-parameters" 98 | tasks.withType(Javadoc) { 99 | options.addStringOption('Xdoclint:none', '-quiet') 100 | } 101 | } 102 | 103 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 104 | sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"] 105 | 106 | configurations.all { 107 | exclude group: 'commons-logging', module: 'commons-logging' 108 | } 109 | 110 | project.tasks.withType(Test).all { 111 | systemProperty("java.awt.headless", "true") 112 | systemProperty("reactor.trace.cancel", "true") 113 | systemProperty("reactor.trace.nocapacity", "true") 114 | systemProperty("testGroups", project.properties.get("testGroups")) 115 | scanForTestClasses = false 116 | include '**/*Tests.*' 117 | include '**/*Spec.*' 118 | exclude '**/*Abstract*.*' 119 | } 120 | 121 | repositories { 122 | if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) { 123 | mavenLocal() 124 | maven { url 'https://repo.spring.io/libs-snapshot' } 125 | } 126 | maven { url 'https://repo.spring.io/libs-release' } 127 | maven { url "https://oss.sonatype.org/content/repositories/releases/" } 128 | jcenter() 129 | mavenCentral() 130 | } 131 | 132 | // dependencies that are common across all java projects 133 | dependencies { 134 | // JSR-305 annotations 135 | optional "com.google.code.findbugs:jsr305:3.0.0" 136 | 137 | // Logging 138 | optional "org.slf4j:slf4j-api:$slf4jVersion" 139 | 140 | compile "io.projectreactor:reactor-core:$reactorVersion" 141 | 142 | testRuntime "ch.qos.logback:logback-classic:$logbackVersion" 143 | // Testing 144 | testCompile "org.hamcrest:hamcrest-library:1.3", 145 | "org.testng:testng:6.8.5" 146 | } 147 | 148 | 149 | if (project.hasProperty('platformVersion')) { 150 | apply plugin: 'spring-io' 151 | 152 | repositories { 153 | maven { url 'https://repo.spring.io/libs-snapshot' } 154 | } 155 | 156 | dependencyManagement { 157 | springIoTestRuntime { 158 | imports { 159 | mavenBom "io.spring.platform:platform-bom:$platformVersion" 160 | } 161 | } 162 | } 163 | } 164 | } 165 | 166 | configurations.all { 167 | // check for updates every build 168 | resolutionStrategy.cacheChangingModulesFor 0, 'seconds' 169 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | version=0.7.0.BUILD-SNAPSHOT -------------------------------------------------------------------------------- /gradle/doc.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | configure(rootProject) { 18 | apply plugin: "java" 19 | apply plugin: 'org.asciidoctor.convert' 20 | 21 | javadoc { 22 | group = "Reactor IPC Javadoc" 23 | 24 | description = "Generates aggregated Javadoc API documentation." 25 | title = "${rootProject.description} ${version} API" 26 | 27 | if (JavaVersion.current().isJava8Compatible()) { 28 | compileTestJava.options.compilerArgs += "-parameters" 29 | tasks.withType(Javadoc) { 30 | options.addStringOption('Xdoclint:none', '-quiet') 31 | } 32 | } 33 | options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED 34 | options.author = true 35 | options.header = rootProject.description 36 | options.overview = "src/api/overview.html" 37 | options.stylesheetFile = file("src/api/stylesheet.css") 38 | options.links(rootProject.ext.javadocLinks) 39 | 40 | source rootProject.sourceSets.main.allJava 41 | 42 | maxMemory = "1024m" 43 | destinationDir = new File(buildDir, "docs/javadoc") 44 | } 45 | 46 | asciidoctor { 47 | sources { 48 | include "index.asciidoc" 49 | } 50 | outputDir file("$buildDir/asciidoc") 51 | backends = ['html5', 'pdf'] 52 | logDocuments = true 53 | options = [doctype: 'book'] 54 | attributes docinfo: '', 55 | toc2: '', 56 | 'compat-mode': '', 57 | stylesdir: "stylesheets/", 58 | stylesheet: 'golo.css', 59 | appversion: "$version", 60 | 'source-highlighter': 'coderay' 61 | 62 | doLast { 63 | file("$outputDir/pdf/index.pdf"). 64 | renameTo("$outputDir/pdf/ipc-reference-guide-${version}.pdf") 65 | } 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /gradle/ide.gradle: -------------------------------------------------------------------------------- 1 | import org.gradle.plugins.ide.eclipse.model.ProjectDependency 2 | import org.gradle.plugins.ide.eclipse.model.SourceFolder 3 | 4 | apply plugin: 'idea' 5 | apply plugin: 'eclipse' 6 | apply plugin: 'propdeps-eclipse' 7 | apply plugin: 'propdeps-idea' 8 | 9 | // Until eclipse fully supports Java 8 use 1.7 source level 10 | eclipse.jdt { 11 | sourceCompatibility = 1.8 12 | targetCompatibility = 1.8 13 | } 14 | 15 | // Replace classpath entries with project dependencies (GRADLE-1116) 16 | eclipse.classpath.file.whenMerged { classpath -> 17 | def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb) 18 | def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp } 19 | projectOutputDependencies.each { entry -> 20 | def matcher = (entry.path =~ regexp) 21 | if (matcher) { 22 | def projectName = matcher[0][1] 23 | def path = "/${projectName}" 24 | if (!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) { 25 | def dependency = new ProjectDependency(path, project(":${projectName}").path) 26 | dependency.exported = true 27 | classpath.entries.add(dependency) 28 | } 29 | classpath.entries.remove(entry) 30 | } 31 | } 32 | classpath.entries.removeAll { entry -> (entry.path =~ /(?!.*?repack.*\.jar).*?\/([^\/]+)\/build\/libs\/[^\/]+\.jar/) } 33 | } 34 | 35 | // Use separate main/test outputs (prevents WTP from packaging test classes) 36 | eclipse.classpath.defaultOutputDir = file(project.name + "/bin/eclipse") 37 | eclipse.classpath.file.beforeMerged { classpath -> 38 | classpath.entries.findAll { it instanceof SourceFolder }.each { 39 | if (it.output?.startsWith("bin/")) { 40 | it.output = null 41 | } 42 | } 43 | } 44 | eclipse.classpath.file.whenMerged { classpath -> 45 | classpath.entries.findAll { it instanceof SourceFolder }.each { 46 | it.output = "bin/" + it.path.split("/")[1] 47 | } 48 | } 49 | 50 | // Allow projects to be used as WPT modules 51 | eclipse.project.natures "org.eclipse.wst.common.project.facet.core.nature" 52 | 53 | // Include project specific settings 54 | task eclipseSettings(type: Copy) { 55 | from rootProject.files( 56 | "src/eclipse/org.eclipse.jdt.ui.prefs", 57 | "src/eclipse/org.eclipse.wst.common.project.facet.core.xml") 58 | into project.file('.settings/') 59 | outputs.upToDateWhen { false } 60 | } 61 | 62 | task eclipseWstComponent(type: Copy) { 63 | from rootProject.files( 64 | "src/eclipse/org.eclipse.wst.common.component") 65 | into project.file('.settings/') 66 | expand(deployname: project.name) 67 | outputs.upToDateWhen { false } 68 | } 69 | 70 | task eclipseJdtPrepare(type: Copy) { 71 | from rootProject.file("src/eclipse/org.eclipse.jdt.core.prefs") 72 | into project.file(".settings/") 73 | outputs.upToDateWhen { false } 74 | } 75 | 76 | task cleanEclipseJdtUi(type: Delete) { 77 | delete project.file(".settings/org.eclipse.jdt.ui.prefs") 78 | delete project.file("org.eclipse.jdt.core.prefs") 79 | delete project.file(".settings/org.eclipse.wst.common.component") 80 | delete project.file(".settings/org.eclipse.wst.common.project.facet.core.xml") 81 | } 82 | 83 | tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare) 84 | tasks["cleanEclipse"].dependsOn(cleanEclipseJdtUi) 85 | tasks["eclipse"].dependsOn(eclipseSettings, eclipseWstComponent) 86 | 87 | // Filter 'build' folder 88 | 89 | eclipse.project.file.withXml { 90 | def node = it.asNode() 91 | 92 | def filteredResources = node.get("filteredResources") 93 | if (filteredResources) { 94 | node.remove(filteredResources) 95 | } 96 | def filterNode = node.appendNode("filteredResources").appendNode("filter") 97 | filterNode.appendNode("id", "1359048889071") 98 | filterNode.appendNode("name", "") 99 | filterNode.appendNode("type", "30") 100 | def matcherNode = filterNode.appendNode("matcher") 101 | matcherNode.appendNode("id", "org.eclipse.ui.ide.multiFilter") 102 | matcherNode.appendNode("arguments", "1.0-projectRelativePath-matches-false-false-build") 103 | } -------------------------------------------------------------------------------- /gradle/setup.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | task wrapper(type: Wrapper, description: "Create a Gradle self-download wrapper") { 18 | group = 'Project Setup' 19 | gradleVersion = "$gradleVersion" 20 | } 21 | 22 | configure(rootProject) { subproject -> 23 | if(subproject.name == 'docs') return 24 | 25 | apply plugin: 'propdeps-maven' 26 | apply plugin: 'maven' 27 | 28 | install { 29 | repositories.mavenInstaller { 30 | customizePom(pom, subproject) 31 | } 32 | } 33 | 34 | jar { 35 | manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})" 36 | manifest.attributes["Implementation-Title"] = subproject.name 37 | manifest.attributes["Implementation-Version"] = subproject.version 38 | } 39 | 40 | task sourcesJar(type: Jar) { 41 | classifier = 'sources' 42 | from sourceSets.main.allSource 43 | } 44 | 45 | task javadocJar(type: Jar) { 46 | classifier = 'javadoc' 47 | from javadoc 48 | } 49 | 50 | artifacts { 51 | archives sourcesJar 52 | archives javadocJar 53 | } 54 | } 55 | 56 | def customizePom(def pom, def gradleProject) { 57 | pom.whenConfigured { generatedPom -> 58 | // eliminate test-scoped dependencies (no need in maven central poms) 59 | generatedPom.dependencies.removeAll { dep -> 60 | dep.scope == "test" 61 | } 62 | 63 | // sort to make pom dependencies order consistent to ease comparison of older poms 64 | generatedPom.dependencies = generatedPom.dependencies.sort { dep -> 65 | "$dep.scope:$dep.groupId:$dep.artifactId" 66 | } 67 | 68 | // add all items necessary for maven central publication 69 | generatedPom.project { 70 | name = gradleProject.description 71 | description = gradleProject.description 72 | url = 'https://github.com/reactor/reactor' 73 | organization { 74 | name = 'reactor' 75 | url = 'https://github.com/reactor' 76 | } 77 | licenses { 78 | license { 79 | name 'The Apache Software License, Version 2.0' 80 | url 'https://www.apache.org/licenses/LICENSE-2.0.txt' 81 | distribution 'repo' 82 | } 83 | } 84 | scm { 85 | url = 'https://github.com/reactor/reactor-ipc' 86 | connection = 'scm:git:git://github.com/reactor/reactor-ipc' 87 | developerConnection = 'scm:git:git://github.com/reactor/reactor-ipc' 88 | } 89 | developers { 90 | developer { 91 | id = 'smaldini' 92 | name = 'Stephane Maldini' 93 | email = 'smaldini@pivotal.io' 94 | } 95 | developer { 96 | id = 'kadyana' 97 | name = 'Anatoly Kadyshev' 98 | } 99 | } 100 | issueManagement { 101 | system = "GitHub Issues" 102 | url = "https://github.com/reactor/reactor/issues" 103 | } 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/reactor-ipc/acccb25e90fe627a521073417adaabfda7376afb/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jul 19 10:36:00 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | rootProject.name = 'reactor-ipc' -------------------------------------------------------------------------------- /src/api/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |11 | Reactor is a succinct and powerful foundational library for building reactive, FastData applications on the JVM. 12 | More detailed documentation is available on the reference guide. 14 |
15 |'32 |
"33 |
'36 |
"37 |
34 | *
Clients or Receivers will onSubscribe when their connection is established. They 35 | * will complete when the unique returned closing {@link Publisher} completes itself or if 36 | * the connection is remotely terminated. Calling the returned {@link 37 | * Disposable#dispose()} from {@link Mono#subscribe()} will terminate the subscription 38 | * and underlying connection from the local peer. 39 | *
40 | *
Servers or Producers will onSubscribe when their socket is bound locally. They will
41 | * never complete as many {@link Publisher} close selectors will be expected. Disposing
42 | * the returned {@link Mono} will safely call shutdown.
43 | *
44 | * @param
59 | * The IO handler will return {@link Publisher} to signal when to terminate the
60 | * underlying resource channel.
61 | *
62 | * @param ioHandler the in/out callback returning a closing publisher
63 | *
64 | * @return a {@link Mono} completing with a {@link Disposable} token to dispose
65 | * the active handler (server, client connection...) or failing with the connection
66 | * error.
67 | */
68 | Mono extends Disposable> newHandler(BiFunction super INBOUND, ? super OUTBOUND, ? extends Publisher
25 | *
26 | * @author Stephane Maldini
27 | * @since 0.6
28 | */
29 | @FunctionalInterface
30 | public interface Inbound
28 | * Writing and "flushing" is controlled by sinking 1 or more {@link #send(Publisher)} that
29 | * will forward data to outbound. When a drained Publisher completes or error, the channel
30 | * will automatically "flush" its pending writes.
31 | *
32 | * @author Stephane Maldini
33 | * @since 0.6
34 | */
35 | @FunctionalInterface
36 | public interface Outbound A new {@link Outbound} type (or the same) for typed send
52 | * sequences. An implementor can therefore specialize the Outbound after a first after
53 | * a prepending data publisher.
54 | *
55 | * @param dataStream the dataStream publishing OUT items to write on this channel
56 | *
57 | * @return A new {@link Outbound} to append further send. It will emit a complete
58 | * signal successful sequence write (e.g. after "flush") or any error during write.
59 | */
60 | Outbound Can be applied to incoming and outgoing service interfaces.
27 | */
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Target(ElementType.METHOD)
30 | public @interface Ipc {
31 | String name() default "";
32 | }
--------------------------------------------------------------------------------
/src/main/java/reactor/ipc/stream/IpcDone.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package reactor.ipc.stream;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | * Indicates the method, which has only an RpcStreamContext parameter and void return
25 | * should be called just after disconnection from the client.
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.METHOD)
29 | public @interface IpcDone {
30 | String name() default "";
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/reactor/ipc/stream/IpcInit.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package reactor.ipc.stream;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | * Indicates the method, which has only an RpcStreamContext parameter and void return
25 | * should be called just after the connection has been established.
26 | */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.METHOD)
29 | public @interface IpcInit {
30 | String name() default "";
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/reactor/ipc/stream/OnStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package reactor.ipc.stream;
17 |
18 | @FunctionalInterface
19 | interface OnStream {
20 |
21 | boolean onStream(long streamId, String function, StreamOperationsImpl manager);
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/reactor/ipc/stream/SimpleStreamConnector.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011-2016 Pivotal Software Inc, All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package reactor.ipc.stream;
18 |
19 | import java.util.Objects;
20 | import java.util.function.BiConsumer;
21 | import java.util.function.BiFunction;
22 | import java.util.function.Function;
23 | import java.util.function.Supplier;
24 |
25 | import org.reactivestreams.Publisher;
26 | import reactor.core.Disposable;
27 | import reactor.core.publisher.Mono;
28 | import reactor.ipc.connector.Connector;
29 | import reactor.ipc.connector.Inbound;
30 | import reactor.ipc.connector.Outbound;
31 |
32 | /**
33 | * @author Stephane Maldini
34 | */
35 | final class SimpleStreamConnector