All Projects → kondi → Rxjs Grpc

kondi / Rxjs Grpc

Licence: mit
Typesafe gRPC with RxJS in TypeScript

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Rxjs Grpc

Book
《Go 语言编程之旅:一起用 Go 做项目》本书涵盖细分为 5 + 1 板块,分别是命令行、HTTP、RPC、Websocket 应用、进程内缓存以及 Go 语言中的大杀器。
Stars: ✭ 167 (-9.24%)
Mutual labels:  grpc
Buf
A new way of working with Protocol Buffers.
Stars: ✭ 3,328 (+1708.7%)
Mutual labels:  grpc
Blog
旧书常读出新意,俗见尽弃作雅人!
Stars: ✭ 173 (-5.98%)
Mutual labels:  rxjs
Flutter Grpc Tutorial
[Tutorial] Asynchronous Flutter chat client with Go chat server which are powered by gRPC (simple and streaming)
Stars: ✭ 167 (-9.24%)
Mutual labels:  grpc
Ketchup
ketchup (番茄酱) 是一个基于dotnet core的微服务框架。
Stars: ✭ 170 (-7.61%)
Mutual labels:  grpc
Talos
Talos is a modern OS for Kubernetes.
Stars: ✭ 2,390 (+1198.91%)
Mutual labels:  grpc
Awesome Reactive Programming
A repository for sharing all the resources available on Reactive Programming and Reactive Systems
Stars: ✭ 163 (-11.41%)
Mutual labels:  rxjs
Buildbuddy
BuildBuddy is an open source Bazel build event viewer, result store, and remote cache.
Stars: ✭ 182 (-1.09%)
Mutual labels:  grpc
Liftbridge
Lightweight, fault-tolerant message streams.
Stars: ✭ 2,175 (+1082.07%)
Mutual labels:  grpc
Grpc Java Contrib
Useful extensions for the grpc-java library
Stars: ✭ 176 (-4.35%)
Mutual labels:  grpc
U Bmc
Open-source firmware for your baseboard management controller (BMC)
Stars: ✭ 166 (-9.78%)
Mutual labels:  grpc
Ng Projects
🌐 A list of open source Angular Projects
Stars: ✭ 167 (-9.24%)
Mutual labels:  rxjs
Makeaplan public
【制定一个计划】是一个目标规划应用,通过最直接,最清晰的方式帮助你记录和追踪自己的计划,辅助你达成自己的目标。
Stars: ✭ 174 (-5.43%)
Mutual labels:  grpc
Micro Starter Kit
Cloud Native GoLang Microservices - gRPC, GraphQL
Stars: ✭ 167 (-9.24%)
Mutual labels:  grpc
Rules proto
Modern bazel build rules for protobuf / gRPC
Stars: ✭ 179 (-2.72%)
Mutual labels:  grpc
Angular Nodejs Mongodb Customersservice
Code for the Integrating Angular with Node.js RESTful Services Pluralsight course.
Stars: ✭ 164 (-10.87%)
Mutual labels:  rxjs
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+1372.83%)
Mutual labels:  grpc
Horus
🎯 A gRPC-Node Distributed Tracing and Monitoring Tool.
Stars: ✭ 184 (+0%)
Mutual labels:  grpc
Go Grpc Examples
This repo contains examples and implementations of different types of GRPC services and APIs using Golang.
Stars: ✭ 180 (-2.17%)
Mutual labels:  grpc
Ft
File Transferer
Stars: ✭ 176 (-4.35%)
Mutual labels:  grpc

Build Status npm version

rxjs-grpc

Installation

$ npm install rxjs-grpc rxjs grpc

Quickstart

Create your protobuf definition file sample.proto:

syntax = "proto3";

package sample;

service Greeter {
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

message HelloRequest {
  string name = 1;
}

message HelloReply {
  string message = 1;
}

Generate your TypeScript interfaces:

$ ./node_modules/.bin/rxjs-grpc -o grpc-namespaces.ts *.proto

Implement your typesafe server returning Observable<sample.HelloReply>:

import { of } from 'rxjs';
import { serverBuilder } from 'rxjs-grpc';
import { sample } from './grpc-namespaces';

// Pass the path of proto file and the name of namespace
const server = serverBuilder<sample.ServerBuilder>('sample.proto', 'sample')
// Add implementation
server.addGreeter({
  sayHello(request: sample.HelloRequest) {
    return of({
      message: 'Hello ' + request.name
    });
  }
})
// Start the server to listen on port 50051
server.start('0.0.0.0:50051');

Call it from a client:

import { clientFactory } from 'rxjs-grpc';
import { sample } from './grpc-namespaces';

// Pass the path of proto file and the name of namespace
const Services = clientFactory<sample.ClientFactory>('sample.proto', 'sample');
// Create a client connecting to the server
const services = new Services('localhost:50051');
// Get a client for the Greeter service
const greeter = services.getGreeter();

// Call the service by passing a sample.HelloRequest
greeter.sayHello({ name: 'world' }).forEach(response => {
  console.log(`Greeting: ${response.message}`);
});

Generated interfaces

import { Observable } from 'rxjs';

export namespace sample {

  export interface ClientFactory {
    getGreeter(): sample.Greeter;
  }

  export interface ServerBuilder {
    addGreeter(impl: sample.Greeter): sample.ServerBuilder;
  }

  export interface Greeter {
    sayHello(request: sample.HelloRequest): Observable<sample.HelloReply>;
  }

  export interface HelloRequest {
    name?: string;
  }

  export interface HelloReply {
    message?: string;
  }

}

Examples

You can see a simple example project in the examples folder.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].