
io.reactivex.netty.examples.tcp.cpuintensive.README.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rx-netty-examples Show documentation
Show all versions of rx-netty-examples Show documentation
rx-netty-examples developed by Netflix
The newest version!
Overview
========
An example of how to write a server which does some CPU intensive or Blocking work and hence is not suitable for running
the connection processing in the channel's event loop.
This is achieved by using netty's [`EventExecutorGroup`](https://github.com/netty/netty/blob/master/common/src/main/java/io/netty/util/concurrent/EventExecutorGroup.java)
as a threadpool.
`RxNetty` makes sure that the [`ConnectionHandler`](https://github.com/Netflix/RxNetty/blob/master/rx-netty/src/main/java/io/reactivex/netty/channel/ConnectionHandler.java)
as well as the subscribers of `ObservableConnection`'s content happens on this executor.
Running
=======
To run the example execute:
```
$ cd RxNetty/rx-netty-examples
$ ../gradlew runCpuIntensiveTcpServer
```
and in another console:
```
$ cd RxNetty/rx-netty-examples
$ ../gradlew runCpuIntensiveTcpClient
```
© 2015 - 2025 Weber Informatics LLC | Privacy Policy