Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provides List of Client-Side Examples #41

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Provides List of Client-Side Examples #41

merged 2 commits into from
Mar 31, 2021

Conversation

OlegDokuka
Copy link
Member

Basic RSocket Client-Side

Motivation:

To give more understanding on how to use RSocket-Swift, this PR adds a list of simple rsocket examples which demonstrate on how to use rsocket-swift in the vanilla scenario as well as integration with frameworks like Spring Boot Messaging RSocket and the use of hand-written composite-metadata support

Modifications:

Adds 5 files in tests/Examples

Result:

More samples on rsocket-swift

Signed-off-by: Oleh Dokuka odokuka@vmware.com

Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
Signed-off-by: Oleh Dokuka <oleh.dokuka@icloud.com>
Signed-off-by: David Nadoba <dnadoba@gmail.com>
@dnadoba
Copy link
Member

dnadoba commented Mar 31, 2021

The examples are now executables and use RSocketNIOChannel instead of RScoketTSChannel to support linux as well.
I have added apple/swift-argument-parser as a dependency to make it possible to configure the examples from CLI.
We can now run the examples by running swift run time-client-example, swift run twitter-client-example or swift run vanilla-client-example.
They also can show help information:

% swift run twitter-client-example --help
OVERVIEW: connects to an RSocket endpoint using WebSocket transport, requests a stream at the route `searchTweets` to search for tweets that match the `searchString`
and logs all events.

USAGE: twitter-client-example [<search-string>] [--host <host>] [--port <port>] [--limit <limit>]

ARGUMENTS:
  <search-string>         used to find tweets that match the given string (default: RSocket)

OPTIONS:
  --host <host>           (default: demo.rsocket.io/rsocket)
  --port <port>           (default: 80)
  --limit <limit>         maximum number of tweets that are taken before it cancels the stream (default: 1000)
  -h, --help              Show help information.

As WebSocket transport is not fully implemented, they do not work yet but I work on that next.

@OlegDokuka OlegDokuka marked this pull request as ready for review March 31, 2021 11:43
@dnadoba dnadoba merged commit 2434e37 into main Mar 31, 2021
@dnadoba dnadoba deleted the enhancement/examples branch March 31, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants