Skip to content

Commit

Permalink
Update docs to match latest info. Change version schema before
Browse files Browse the repository at this point in the history
tagging a release to match support for nng 1.8.0.
  • Loading branch information
voutilad committed Aug 15, 2024
1 parent 0b17c7d commit 3f25ba6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ An idiomatic Java wrapper around [nng](https://nng.nanomsg.org) using
> a Java application...but we'll see if/when I get there.
## Current State
As of _15 Aug 2024_, things have been updated to work with `nng 1.8.0` using
Java 11. The only thing added (that was previously missing) were calls to
register the tls service and the ability to set a trusted CA on a client's
`TlsConfig`.

As of _8 Feb 2021_, the core nng primitives are implemented allowing a Java
developer to:

Expand Down
26 changes: 15 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ plugins {
}

java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
}

group 'io.sisu'
version '1.8.0-SNAPSHOT'
// Given the versioning pattern x.x.x-y-z, the plan is x.x.x follows the
// expected version of nng supported. The y is the major release of this
// library against that version and z is the patch release of the major.
// Yes, it's a bit ugly, but it follows some conventions blessed by
// Oracle:
// https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8904
version '1.8.0-0-0'

repositories {
mavenCentral()
Expand All @@ -33,8 +39,8 @@ project(':benchmarks') {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
}
group = 'io.sisu.nng'
version = parent.version
Expand All @@ -59,8 +65,8 @@ project(':demo') {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
}
group = 'io.sisu.nng'
version = parent.version
Expand All @@ -79,21 +85,19 @@ project(':demo') {
}
}

/*
task runDemoAsyncServer(type: JavaExec) {
group = "Execution"
description = "Run the Async Server demo"
classpath = sourceSets.main.runtimeClasspath
main = $/io.sisu.nng.demo.async.Server/$
mainClass = $/io.sisu.nng.demo.async.Server/$
environment "JNA_LIBRARY_PATH", System.getenv("JNA_LIBRARY_PATH")
}

task runDemoAsyncClient(type: JavaExec) {
group = "Execution"
description = "Run the Async Client demo"
classpath = sourceSets.main.runtimeClasspath
main = $/io.sisu.nng.demo.async.Client/$
mainClass = $/io.sisu.nng.demo.async.Client/$
environment "JNA_LIBRARY_PATH", System.getenv("JNA_LIBRARY_PATH")
}
*/
}
14 changes: 8 additions & 6 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ $ ./gradlew demo:shadowJar
Running a demo should then be as easy as:

```
$ java -cp ./demo/libs/demo-${version}-all.jar <demo class> <...args>
$ java -cp ./demo/build/libs/demo-${version}-all.jar <demo class> <...args>
```

> You may need to set your JNA_LIBRARY_PATH to find nng!
Where `${version}` is the current version of the nng-java project.

> The upstream nng demos are here:
Expand All @@ -40,15 +42,15 @@ The demo is simple:
To start the server, provide a valid nng url to listen on:

```
$ java -cp ./demo/libs/demo-${version}-all.jar \
$ java -cp ./demo/build/libs/demo-${version}-all.jar \
io.sisu.nng.demo.async.Server \
tcp://localhost:9999
```

Then start some clients, providing a "wait time" argument (in milliseconds):

```
$ java -cp ./demo/libs/demo-${version}-all.jar \
$ java -cp ./demo/build/libs/demo-${version}-all.jar \
io.sisu.nng.demo.async.Client \
tcp://localhost:9999 100
```
Expand All @@ -73,7 +75,7 @@ is enabled by adding a numeric sleep argument while the server takes a `-s`
flag:

```
$ java -cp ./demo/libs/demo-${version}-all.jar \
$ java -cp ./demo/build/libs/demo-${version}-all.jar \
io.sisu.nng.demo.raw.Raw \
tcp://localhost:9999 [-s | <sleep time in seconds>]
```
Expand All @@ -88,15 +90,15 @@ Socket.
For the server, start via:

```
$ java -cp ./demo/libs/demo-${version}-all.jar \
$ java -cp ./demo/build/libs/demo-${version}-all.jar \
io.sisu.nng.demo.reqreq.ReqRep server
tcp://localhost:9999
```

And the client:

```
$ java -cp ./demo/libs/demo-${version}-all.jar \
$ java -cp ./demo/build/libs/demo-${version}-all.jar \
io.sisu.nng.demo.reqreq.ReqRep client
tcp://localhost:9999
```

0 comments on commit 3f25ba6

Please sign in to comment.