Skip to content

Repository files navigation

RSocket-py

Python implementation of RSocket

Installation

The latest version from pypi can be installed using:

pip install rsocket

You may also install using some extras:

ExtraFunctionalityDocumentation
rxReactiveX (v3) integrationTutorial
reactivexReactiveX (v4) integrationTutorial
aiohttpaiohttp Websocket transport (server/client)Tutorial
fastapifastapi Websocket transport (server/client)
channelsWebsocket transport (server only) using channels (django)
quartQuart Websocket transport (server only)
quicQUIC transport
websocketsWebsockets transport (server only)
asyncwebsocketsWebsockets transport (client only)
cliCommand lineTutorial
optimizedFrame parse/serialize optimizations
cloudeventsCloudEvents integration
graphqlGraphQL integrationTutorial

For example:

pip install rsocket[reactivex]

Alternatively, download the source code, build a package:

python3 setup.py bdist_wheel

Use the resulting package from the ./dist folder, or install locally:

python3 setup.py install

Documentation

Documentation is available on the official rsocket.io site. API documentation is at readthedocs.io.

Examples

Examples can be found in the /examples folder. It contains various server and client usages. The following is a table denoting which client example is constructed to be run against which server example. Some examples are in java to show compatibility with a different implementation. To run the java examples first build using mvn package.

The examples/test_examples.py can be used to execute the relevant example server/client pairs.

client_springboot.py is set up to work against the Spring RSocket demo.

server (python)server (java)client (python)client(java)
server.pyclient.py
server_quic.pyclient_quic.py
server_with_lease.pyClientWithLease
server_with_routing.pyclient_with_routing.pyClient
server_with_routing.pyclient_rx.py
server_with_routing.pyclient_reconnect.py
Serverrun_against_example_java_server.py
ServerWithFragmentationclient_with_routing.py
server_quart_websocket.pyclient_websocket.py
server_aiohttp_websocket.pyclient_websocket.py
server_fastapi_websocket.pyclient_websocket.py
server_graphql.pyServerWithGraphQLclient_graphql.py

Build Status

build masterCoverage StatusCodeQL

Progress

  • Requests
    • Fire and forget
    • Response
    • Stream
    • Channel
    • Metadata push
  • Features
    • Keepalive / Max server life
    • Lease
    • Resume
    • Fragmentation
  • Extensions
    • Composite metadata
    • Per Stream Mimetype
    • Routing
    • Authentication
  • Transports
    • TCP
    • Websocket (WS, WSS) - Quart and aiohttp integration
    • QUIC
    • HTTP/3
    • HTTP/2
    • Aeron
  • RxPy Integration
    • Stream Response
    • Channel Response
    • Channel Requester stream
    • Response
  • Other
    • Reconnect
    • Load balancing
    • Server routing definition helper (Flask like syntax)
    • Reactivex integration (v3, v4) server/client side
    • Command line interface

About

RSocket implementation in Python

Resources

Code of conduct

Contributing

Security policy

Stars

83 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages