<commit_before>= Vert.x RxJava2 extension examples

**IMPORTANT**: These examples use the RX Java 2 API. If you are interested by RX Java 1, check the `rxjava-1-examples`
module.

Here you will find examples demonstrating Vert.x RxJava2 extension in action.

Vert.x RxJava 2 extension provides Rxified version of the Vert.x APIs. Please consult the Vert.x RxJava manual
for detailed documentation on Vert.x core.

== RxJava Web client examples

These examples shows the Rxified HTTP api.

=== Simple

A simple web client.

The client creates an `Single<HttpRequest<String>>` and then subscribe multiple times to the single to send the request.

link:src/main/java/io/vertx/example/reactivex/web/client/simple/Client.java[RxJava 2 simple web client]

=== Zip

A variation of the _simple_ example with two client requests mapped to an `Single<JsonObject>`
 and then _zipped_ in a single json object.

The main interest is to get the final result when the two responses are delivered.

link:src/main/java/io/vertx/example/reactivex/web/client/zip/Client.java[RxJava 2 zip web client]

=== Unmarshalling

The web client json response is unmarshalled to a Java object using the web client unmarshalling features.

link:src/main/java/io/vertx/example/reactivex/web/client/unmarshalling/Client.java[RxJava 2 unmarshalling web client]

== RxJava Web examples

=== Real-time

This example demonstrates how an RxJava `Flowable` source can be sent _real-time_ to the browser
via a `SockJSSocket`.

link:src/main/java/io/vertx/example/reactivex/web/realtime/Server.java[RxJava 2 real-time web]

SocksJS gives a WebSocket-like API in client side JavaScript even if the browser or network doesn't support WebSockets.

This is ideal for so-called _real-time_ web applications where you want quick, responsive communication between server
and client and you're probably rendering the user interface on the client side.

Run the server either in your IDE or on the command line, then open your browser and hit
link:http://localhost:8080

This serves the link:src/main/java/io/vertx/example/reactivex/web/realtime/webroot/index.html[index page] which contains
some JavaScript which opens an event bus connection to the server.

When the connection is open, a SockJS connection is opened on the `/news-feed` uri. When data
arrives in the handler the script just uses some simple JQuery to write the message to the page.

On the server side, in the link:src/main/java/io/vertx/example/reactivex/web/realtime/Server.java[server] when a SockJS
connection arrives, we subscribe to an `Flowable<String>` (that is created from the EventBus, but it would be
another source of data) and send to the browser the observed items.

When you get the index page in your browser you should see it update every second as it receives a message.

== RxJava 2 Http examples

These examples shows the Rxified HTTP api.

=== Simple

A simple http server and client.

The server uses an `Flowable<HttpServerRequest>` to serve request:

link:src/main/java/io/vertx/example/reactivex/http/client/simple/Server.java[RxJava 2 simple HTTP server]

The client uses an `Flowable<HttpClientRequest` and applies `flatMap` to get a `Flowable<Buffer>`

link:src/main/java/io/vertx/example/reactivex/http/client/simple/Client.java[RxJava 2 simple HTTP client]

=== Reduce

Same as _simple_ example however the client applies several operations on this flowable to end
with the http client response:

* `flatMap` transforms the `Flowable<HttpClientResponse>` -> `Flowable<Buffer>`
* `reduce` merge all response buffers in a single buffer
* `map` transform the buffer to a string
* `subscribe` delivers the response content

link:src/main/java/io/vertx/example/reactivex/http/client/reduce/Client.java[RxJava 2 reduce HTTP client]

=== Zip

A variation of the _simple_ example with two client requests mapped to an `Flowable<JsonObject>`
 and then _zipped_ in a single json object.

The main interest is to get the final result when the two responses are delivered.

link:src/main/java/io/vertx/example/reactivex/http/client/zip/Client.java[RxJava 2 zip HTTP client]

=== Unmarshalling

The http client json response is unmarshalled to a Java object: the `RxHelper.unmarshaller` static method
 creates an Rx operator applied to the response via the `lift`.

link:src/main/java/io/vertx/example/reactivex/http/client/unmarshalling/Client.java[RxJava 2 unmarshalling HTTP client]

== RxJava event bus examples

The event bus provides a natural fit with the Rx api.

=== Publish / Subscribe

A reinterpreation of the core publish / subscribe example with the subscriber using the Rx api.

link:src/main/java/io/vertx/example/reactivex/eventbus/pubsub/Receiver.java[RxJava 2 event bus pubsub receiver]
link:src/main/java/io/vertx/example/reactivex/eventbus/pubsub/Sender.java[RxJava 2 event bus pubsub sender]

=== Ping / Pong

An example of sending, receiving and replying to messages using the Rx api.

link:src/main/java/io/vertx/example/reactivex/eventbus/pingpong/PingPong.java[RxJava 2 simple ping-pong ]

=== Zip replies

The example Sender sends two messages over the event bus and wait for replies, the
_zip_ operation is applied to deliver a single reply when the two replies are received.

link:src/main/java/io/vertx/example/reactivex/eventbus/zipreplies/Receiver.java[RxJava 2 zipreplies eventbus receiver]
link:src/main/java/io/vertx/example/reactivex/eventbus/zipreplies/Sender.java[RxJava 2 zipreplies eventbus sender]

== RxJava 2 Database examples

=== Jdbc example

An example showing the Jdbc Service Rxified api, after the client connected to the database, it chains
operations via the `flatMap` operation and then subscribes to the result.

link:src/main/java/io/vertx/example/reactivex/database/jdbc/Client.java[RxJava 2 JDBC client]

=== Mongo example

An example showing the Mongo Service Rxified api, after the client connected to Mongo, it chains
`createCollection` and `insert` via _flatMap_ and then subscribes to the result to do a query
in the _onComplete_.

link:src/main/java/io/vertx/example/reactivex/database/mongo/Client.java[RxJava 2 Mongo client]

== Scheduler examples

Vertx for RxJava provides schedulers for performing delayed, periodic actions.

=== Periodic events

RxJava timer can use Vertx scheduler for scheduling actions on the event loop, this example shows a 1 second
periodic flowable scheduled on Vertx event loop.

link:src/main/java/io/vertx/example/reactivex/scheduler/timer/Periodic.java[Periodic scheduled action]

=== Blocking action example

When an Flowable operation is blocking, a blocking Vertx scheduler can be used to perform the action, this
examples shows how blocking operation can be scheduled on Vert.x

link:src/main/java/io/vertx/example/reactivex/scheduler/blocking/Scheduled.java[Blocking scheduled action]
link:src/main/java/io/vertx/example/reactivex/scheduler/blocking/Scheduled.java[Blocking scheduled action]

== Scheduler examples

These examples demonstrate usage of Vert.x net servers and clients with RxJava2

=== Greeter

This example combines `RecordParser` and RxJava2 for a TCP client/server exchange.
When the client sends a name to the server, it replies with a greeting.
Names and greetings are line-separated.

link:src/main/java/io/vertx/example/reactivex/net/greeter/Client.java[Greeting client]
link:src/main/java/io/vertx/example/reactivex/net/greeter/Server.java[Greeting Server]<commit_msg>Fill in the missing Doc and sign<commit_after>= Vert.x RxJava2 extension examples

**IMPORTANT**: These examples use the RX Java 2 API. If you are interested by RX Java 1, check the `rxjava-1-examples`
module.

Here you will find examples demonstrating Vert.x RxJava2 extension in action.

Vert.x RxJava 2 extension provides Rxified version of the Vert.x APIs. Please consult the Vert.x RxJava manual
for detailed documentation on Vert.x core.

== RxJava Web client examples

These examples shows the Rxified HTTP api.

=== Simple

A simple web client.

The client creates an `Single<HttpRequest<String>>` and then subscribe multiple times to the single to send the request.

link:src/main/java/io/vertx/example/reactivex/web/client/simple/Client.java[RxJava 2 simple web client]

=== Zip

A variation of the _simple_ example with two client requests mapped to an `Single<JsonObject>`
 and then _zipped_ in a single json object.

The main interest is to get the final result when the two responses are delivered.

link:src/main/java/io/vertx/example/reactivex/web/client/zip/Client.java[RxJava 2 zip web client]

=== Unmarshalling

The web client json response is unmarshalled to a Java object using the web client unmarshalling features.

link:src/main/java/io/vertx/example/reactivex/web/client/unmarshalling/Client.java[RxJava 2 unmarshalling web client]

== RxJava Web examples

=== Real-time

This example demonstrates how an RxJava `Flowable` source can be sent _real-time_ to the browser
via a `SockJSSocket`.

link:src/main/java/io/vertx/example/reactivex/web/realtime/Server.java[RxJava 2 real-time web]

SocksJS gives a WebSocket-like API in client side JavaScript even if the browser or network doesn't support WebSockets.

This is ideal for so-called _real-time_ web applications where you want quick, responsive communication between server
and client and you're probably rendering the user interface on the client side.

Run the server either in your IDE or on the command line, then open your browser and hit
link:http://localhost:8080

This serves the link:src/main/java/io/vertx/example/reactivex/web/realtime/webroot/index.html[index page] which contains
some JavaScript which opens an event bus connection to the server.

When the connection is open, a SockJS connection is opened on the `/news-feed` uri. When data
arrives in the handler the script just uses some simple JQuery to write the message to the page.

On the server side, in the link:src/main/java/io/vertx/example/reactivex/web/realtime/Server.java[server] when a SockJS
connection arrives, we subscribe to an `Flowable<String>` (that is created from the EventBus, but it would be
another source of data) and send to the browser the observed items.

When you get the index page in your browser you should see it update every second as it receives a message.

== RxJava 2 Http examples

These examples shows the Rxified HTTP api.

=== Simple

A simple http server and client.

The server uses an `Flowable<HttpServerRequest>` to serve request:

link:src/main/java/io/vertx/example/reactivex/http/client/simple/Server.java[RxJava 2 simple HTTP server]

The client uses an `Flowable<HttpClientRequest` and applies `flatMap` to get a `Flowable<Buffer>`

link:src/main/java/io/vertx/example/reactivex/http/client/simple/Client.java[RxJava 2 simple HTTP client]

=== Reduce

Same as _simple_ example however the client applies several operations on this flowable to end
with the http client response:

* `flatMap` transforms the `Flowable<HttpClientResponse>` -> `Flowable<Buffer>`
* `reduce` merge all response buffers in a single buffer
* `map` transform the buffer to a string
* `subscribe` delivers the response content

link:src/main/java/io/vertx/example/reactivex/http/client/reduce/Client.java[RxJava 2 reduce HTTP client]

=== Zip

A variation of the _simple_ example with two client requests mapped to an `Flowable<JsonObject>`
 and then _zipped_ in a single json object.

The main interest is to get the final result when the two responses are delivered.

link:src/main/java/io/vertx/example/reactivex/http/client/zip/Client.java[RxJava 2 zip HTTP client]

=== Unmarshalling

The http client json response is unmarshalled to a Java object: the `RxHelper.unmarshaller` static method
 creates an Rx operator applied to the response via the `lift`.

link:src/main/java/io/vertx/example/reactivex/http/client/unmarshalling/Client.java[RxJava 2 unmarshalling HTTP client]

== RxJava event bus examples

The event bus provides a natural fit with the Rx api.

=== Publish / Subscribe

A reinterpreation of the core publish / subscribe example with the subscriber using the Rx api.

link:src/main/java/io/vertx/example/reactivex/eventbus/pubsub/Receiver.java[RxJava 2 event bus pubsub receiver]
link:src/main/java/io/vertx/example/reactivex/eventbus/pubsub/Sender.java[RxJava 2 event bus pubsub sender]

=== Ping / Pong

An example of sending, receiving and replying to messages using the Rx api.

link:src/main/java/io/vertx/example/reactivex/eventbus/pingpong/PingPong.java[RxJava 2 simple ping-pong ]

=== Zip replies

The example Sender sends two messages over the event bus and wait for replies, the
_zip_ operation is applied to deliver a single reply when the two replies are received.

link:src/main/java/io/vertx/example/reactivex/eventbus/zipreplies/Receiver.java[RxJava 2 zipreplies eventbus receiver]
link:src/main/java/io/vertx/example/reactivex/eventbus/zipreplies/Sender.java[RxJava 2 zipreplies eventbus sender]

== RxJava 2 Database examples

=== Jdbc example

An example showing the Jdbc Service Rxified api, after the client connected to the database, it chains
operations via the `flatMap` operation and then subscribes to the result.

link:src/main/java/io/vertx/example/reactivex/database/jdbc/Client.java[RxJava 2 JDBC client]

=== Mongo example

An example showing the Mongo Service Rxified api, after the client connected to Mongo, it chains
`createCollection` and `insert` via _flatMap_ and then subscribes to the result to do a query
in the _onComplete_.

link:src/main/java/io/vertx/example/reactivex/database/mongo/Client.java[RxJava 2 Mongo client]

== Scheduler examples

Vertx for RxJava provides schedulers for performing delayed, periodic actions.

=== Periodic events

RxJava timer can use Vertx scheduler for scheduling actions on the event loop, this example shows a 1 second
periodic flowable scheduled on Vertx event loop.

link:src/main/java/io/vertx/example/reactivex/scheduler/timer/Periodic.java[Periodic scheduled action]

=== Blocking action example

When an Flowable operation is blocking, a blocking Vertx scheduler can be used to perform the action, this
examples shows how blocking operation can be scheduled on Vert.x

link:src/main/java/io/vertx/example/reactivex/scheduler/blocking/Scheduled.java[Blocking scheduled action]
link:src/main/java/io/vertx/example/reactivex/scheduler/blocking/Scheduled.java[Blocking scheduled action]

== Scheduler examples

These examples demonstrate usage of Vert.x net servers and clients with RxJava2

=== Greeter

This example combines `RecordParser` and RxJava2 for a TCP client/server exchange.
When the client sends a name to the server, it replies with a greeting.
Names and greetings are line-separated.

link:src/main/java/io/vertx/example/reactivex/net/greeter/Client.java[Greeting client]
link:src/main/java/io/vertx/example/reactivex/net/greeter/Server.java[Greeting Server]

== Rxjava2 Services examples

Provide Rxified Vert.x Services examples

=== Service Proxy example

This example shows you how to make your service proxy Rxified with Rxjava.

link:src/main/java/io/vertx/example/reactivex/services/serviceproxy/ServiceConsumerVerticle.java[Service Consumer Verticle]
link:src/main/java/io/vertx/example/reactivex/services/serviceproxy/SomeDatabaseServiceVerticle.java[Service Provider Verticle]
link:src/main/java/io/vertx/example/reactivex/services/serviceproxy/SomeDatabaseService.java[Service Proxy interface]
{'fraction_non_alphanumeric': 0.073257698541329, 'fraction_numerical': 0.004084278768233388, 'mean_word_length': 4.89904397705545, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1336923', 'n_tokens_mistral': 4604, 'n_tokens_neox': 4360, 'n_words': 1748}