Giter VIP home page Giter VIP logo

reactive-rpc's Introduction

Reactive-RPC

Reactive RPC over WebSocket and HTTP. Both, request and response can be an observable (a stream of data).

type RpcCall = (method: string, payload: Observable<unknown>) => Observable<unknown>;

README-driven-development (stuff below is what it should be like, not what is already implemented:

RPC method types

Similar to gRPC, Reactive-RPC lets you define four kinds of RPC methods:

  1. Unary RPCs where the client sends a single request to the server and gets a single response back, just like a normal RPC call.
type RpcCall = (method: string, payload: unknown) => Promise<unknown>;
  1. Server streaming, where the client sends a request to the server and gets a stream to read a sequence of messages back.
type RpcCall = (method: string, payload: unknown) => Observable<unknown>;
  1. Client streaming RPCs request payload, where the client writes a sequence of messages and sends them to the server.
type RpcCall = (method: string, payload: Observable<unknown>) => Promise<unknown>;
  1. Bi-directional request and response streaming RPCs, where both sides send a sequence of messages using a read-write stream. The two streams operate independently, so clients and servers can read and write in whatever order they like.
type RpcCall = (method: string, payload: Observable<unknown>) => Observable<unknown>;

reactive-rpc's People

Contributors

streamich avatar

Watchers

 avatar  avatar  avatar

reactive-rpc's Issues

Message validation

  • Invalid syntax
    • Send back .err notification
  • Invalid semantics
    • Check message IDs
    • Check method names are ASCII
    • Check payload
    • Check out-of-bounds errors for binary messages

Error formatting

  • Check various popular error formats (Nodde, Boom, other servers)
  • Format errors automatically on the server
  • Expose error formatting functions

Authentication

Extract authentication token from:

  • Authorization header
  • Using access_token URL search param.
  • Using token URL search param.
  • Using Sec-WebSocket-Protocol header, as X-Authorization=<base64 token>
  • sub-protocol.

`RpcDuplex`

  • Class which implements Reactive-RPC server and client
  • Basic unit tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.