Skip to content

Commit

Permalink
Update sample code in RSocketConnector Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
making authored Feb 2, 2021
1 parent f2cfe20 commit 7cdd752
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rsocket-core/src/main/java/io/rsocket/core/RSocketConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,20 @@
* <pre>{@code
* import io.rsocket.transport.netty.client.TcpClientTransport;
*
* RSocketClient client =
* RSocketConnector.createRSocketClient(TcpClientTransport.create("localhost", 7000));
* Mono<RSocket> source =
* RSocketConnector.connectWith(TcpClientTransport.create("localhost", 7000));
* RSocketClient client = RSocketClient.from(source);
* }</pre>
*
* <p>To customize connection settings before connecting:
*
* <pre>{@code
* RSocketClient client =
* Mono<RSocket> source =
* RSocketConnector.create()
* .metadataMimeType("message/x.rsocket.composite-metadata.v0")
* .dataMimeType("application/cbor")
* .toRSocketClient(TcpClientTransport.create("localhost", 7000));
* .connect(TcpClientTransport.create("localhost", 7000));
* RSocketClient client = RSocketClient.from(source);
* }</pre>
*/
public class RSocketConnector {
Expand Down Expand Up @@ -112,7 +114,7 @@ public static RSocketConnector create() {
* Static factory method to connect with default settings, effectively a shortcut for:
*
* <pre class="code">
* RSocketConnector.create().connectWith(transport);
* RSocketConnector.create().connect(transport);
* </pre>
*
* @param transport the transport of choice to connect with
Expand Down

0 comments on commit 7cdd752

Please sign in to comment.