Skip to content
A networking framework that evolves with your application
Java Other
  1. Java 99.4%
  2. Other 0.6%
Branch: master
Clone or download
blake-bauman and NiteshKant Support for Single.fromCallable(), Single.fromSupplier(), Completable…
….fromRunnable() (#850)

Motivation:

Currently, if we want to take a piece of non-asynchronous code and create a Single out of it for a response, we’d have to do one of the following:

* Use CompletableFuture or a Mono to encapsulate the code, and then use Single.fromStage()
* Use Single.defer(() -> Single.succeeded(…))

While this works, it’s an extra step that can be provided as a shortcut in the Single class itself.  Both Mono (Project Reactor) and CompletableFuture offer ways of creating deferred executions via a Supplier, Callable, or Runnable.  However, to use the streaming server it has to be of type Single.  It makes sense for Single to have these capabilities directly.

Modifications:

- Added fromCallable() and fromSupplier() to Single
- Added fromRunnable() to Completable
- Added related tests

Result:

Increased simplicity
Latest commit 1e687e6 Nov 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
buildSrc Inherit buildscript repositories in Gradle plugin builds (#770) Sep 10, 2019
docker
docs Update Gradle version to 5.6.4 (#860) Nov 11, 2019
gradle/wrapper Update Gradle version to 5.6.4 (#860) Nov 11, 2019
scripts Do not override older javadoc with anotra's placeholder (#857) Nov 11, 2019
servicetalk-annotations Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-benchmarks Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-bom BOM is not publishing artifacts (#859) Nov 9, 2019
servicetalk-buffer-api
servicetalk-buffer-netty Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-client-api-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-client-api Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-concurrent-api-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-concurrent-api Support for Single.fromCallable(), Single.fromSupplier(), Completable… Nov 11, 2019
servicetalk-concurrent-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-concurrent-reactivestreams Support for Single.fromCallable(), Single.fromSupplier(), Completable… Nov 11, 2019
servicetalk-concurrent Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-data-jackson-jersey Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-data-jackson Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-data-protobuf Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-dns-discovery-netty Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-examples Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-gradle-plugin-internal BOM is not publishing artifacts (#859) Nov 9, 2019
servicetalk-grpc-api Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-grpc-gradle-plugin Update README with maven-central info (#858) Nov 9, 2019
servicetalk-grpc-netty Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-grpc-protobuf Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-grpc-protoc Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-http-api Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-http-netty Parse headers with no whitespaces (#856) Nov 8, 2019
servicetalk-http-router-jersey-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-http-router-jersey Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-http-router-predicate Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-http-security-jersey Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-http-utils Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-loadbalancer Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
servicetalk-log4j2-mdc-utils Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-log4j2-mdc Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-oio-api
servicetalk-opentracing-asynccontext Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-http Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-inmemory-api Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-inmemory Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-log4j2 Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-opentracing-zipkin-publisher Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-serialization-api Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-tcp-netty-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-test-resources Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-transport-api Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-transport-netty-internal Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
servicetalk-transport-netty Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
.git.commit.template Adding contributing guide and contributors list. (#570) May 22, 2019
.gitignore Update to Gradle 5 and drastically simplify build (#756) Sep 3, 2019
CODE_OF_CONDUCT.adoc Sync files in the root folder with docs pages (#808) Oct 14, 2019
CONTRIBUTING.adoc
LICENSE.txt Add LICENSE.txt Aug 7, 2018
README.adoc Update README with maven-central info (#858) Nov 9, 2019
build.gradle Enable publish to maven central via Sonatype with plugin scoping (#849) Nov 7, 2019
gradle.properties Preparing for 0.21.0-SNAPSHOT development Nov 8, 2019
gradlew Update gradlew to 4.7 Aug 7, 2018
settings.gradle Add HTTP/2 examples and documentation (#839) Nov 2, 2019

README.adoc

ServiceTalk

Maven Central

ServiceTalk is a JVM network application framework with APIs tailored to specific protocols (e.g. HTTP/1.x, HTTP/2.x, etc…​) and supports multiple programming paradigms.

It is built on Netty and is designed to provide most of the performance/scalability benefits of Netty for common networking protocols used in service to service communication. ServiceTalk provides server support and "smart client" like features such as client-side load balancing and service discovery integration.

See the ServiceTalk docs for more information.

Getting Started

ServiceTalk releases are available on Maven Central.

For Gradle as well as other build tools that don’t use Maven Central as a default repository, additional configuration is required.

Gradle, build.gradle
repositories {
  jcenter() // combines Maven Central and other popular repositories
}

Refer to the ServiceTalk docs for various examples that will get you started with the different features of ServiceTalk.

Note
Builds of the development version are available in Sonatype’s snapshots Maven repository.

Supported JVM

The minimum supported JDK version is 1.8.

Compatibility

ServiceTalk follows SemVer 2.0.0. API/ABI breaking changes will require package renaming for that module to avoid runtime classpath conflicts.

Note
0.x.y releases are not stable and are permitted to break API/ABI.

Contributor Setup

Important
If you’re intending to contribute to ServiceTalk, make sure to first read the contribution guidelines.

ServiceTalk uses Gradle as its build tool and only requires JDK 8 or higher to be pre-installed. ServiceTalk ships with the Gradle Wrapper, which means that there is no need to install Gradle on your machine beforehand.

File Encoding

ServiceTalk’s source code is UTF-8 encoded: make sure your filesystem supports it before attempting to build the project. Setting the JAVA_TOOL_OPTIONS env var to -Dfile.encoding=UTF-8 should help building the project in non-UTF-8 environments. Editors and IDEs must also support UTF-8 in order to successfully edit ServiceTalk’s source code.

Gradle Repositories

ServiceTalk’s build produces custom Gradle plugins and thus has regular (i.e. non-buildscript) dependencies on other plugins. This is the reason why the repositories that are provided if none are configured globally are the following:

allprojects {
  buildscript {
    repositories {
      jcenter()
      maven { url "https://plugins.gradle.org/m2/" }
    }
  }
  repositories {
    jcenter()
    maven { url "https://plugins.gradle.org/m2/" }
  }
}

If you have defined repositories or repository mirrors in your global Gradle config (~/.gradle/init.gradle), the build will detect them and attempt to inherit buildscript repositories into the main repositories of the sub-projects that produce custom Gradle plugins.

Note
This inheritance mechanism can be disabled by setting a Gradle property:
-PdisableInheritBuildscriptRepositories.

Build Commands

You should be able to run the following command to build ServiceTalk:

$ ./gradlew build

The supported IDE is IntelliJ IDEA. In order to generate IntelliJ IDEA project files for ServiceTalk, you can run the following command:

$ ./gradlew idea

When done, running one of following commands would open ServiceTalk in IntelliJ:

Generic
$ idea .
macOS
$ open servicetalk.ipr
You can’t perform that action at this time.