0.0.13 • Published 2 years ago

ng-rsocket-rxjs v0.0.13

Weekly downloads
25
License
Apache 2.0
Repository
github
Last release
2 years ago

NgRsocketRxjs

Basic library implementing RSockets RC 1 (Version 1.0).

What this is:

This library provides a basic RSocket client implementing the following features:

  • Request FNF - Both directions
  • Request Response - Both directions
  • Request Stream - Both direction + Backpressure support
  • Websocket Transport
  • RSocket Security (Only tested 'simple') (tested with spring-boot 2.5.0)

Additional features

  • MimeTypes:
    • application/json using JSON.stringify/parse
    • application/octet-stream giving and using UInt8Arrays
    • 'MESSAGE_X_RSOCKET_ROUTING' to work with spring-boot rsocket MessageMapping etc.
    • 'message/x.rsocket.mime-type.v0' to work with spring-boot mime type encoders
  • Automatic reconnect when using RSocketBuilder
  • A service that can be used in your Angular Project to ease establishing of the connection (works well with Spring Boot RSocket)

What this isn't:

  • A full implementation of the RSocket Spec. Missing:
    • Lease Handling
    • Server Setup
    • Resume Support
    • Request Channel
    • Metadata Push
    • Most MimeTypes
  • A library that can be used in any javascript project
    • In Theory the code is split up into Angular dependent code and raw Typescript code. Sadly I have no experience in writing JS/TS libraries and have no idea how to setup the build system correctly...
  • The library is also not deeply tested, but works well for my projects (which is always a Spring Boot - Angular Stack)

How to use in Angular

Import module using forRoot()

RSocketRxjsModule.forRoot({
        url: "ws://<host>:8080/<endpoint>",
        reconnectTimeout: 5000
      })

Now simply have RSocketService injected and us the fluent api to construct calls.

service.route(<route>).data(<data>).requestStream().subscribe(ans => {
      // handle answer
    });
service.route(<route>).data(<data>).requestResponse().subscribe(ans => {
      // handle answer
    });
service.route(<route>).data(<data>).fireAndForget();
0.0.13

2 years ago

0.0.12

3 years ago

0.0.11-beta.0

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago