Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/shidel-dev/async-grpc

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/shidel-dev/async-grpc

  • v0.0.0-20200302041020-5b2b984f2e10
  • Source
  • Go
  • Socket score

Version published
Created
Source

async-grpc

An async grpc implementation for ruby. Build on top of Async, and google-protobuf

Supports:

  • Code Generation
  • Request Response RPCs

Why async?

TLDR; For many workloads it can handle higher concurrency, with lower latency then the reference grpc implimentation for ruby.

The reference implimentation of grpc for ruby is built on top of a c++ server implimentation, with c shims, and a ruby wrapper. It has a concurrency model that does not suit low lantancy responses when there are concurrent requests. The reason for this is due to the fact that it uses a bounded thread pool to execute application code. While this might work for some use cases it is limiting due the GIL, and switching/memory overhead of threads. Reference.

How do I use it?

For users of the reference implimentation it should be a drop in replacement (TODO: fix some things that make this statement not true).

Installation

add the following line to you gem file

source "https://rubygems.pkg.github.com/shidel-dev" do
  gem "async-grpc", "0.1"
end

Code generation

Requires a working go installation

go get github.com/shidel-dev/async-grpc/protoc-gen-async_grpc_ruby

Make sure protoc-gen-async_grpc_ruby is in your path

protoc --proto_path=. --ruby_out=lib --async_grpc_ruby_out=lib my_service.proto

Start a server

require "async/grpc"
require "hello_service_def"
class MyService < Helloworld::GreeterService
  def say_hello(req, metadata)
    Helloworld::HelloReply.new( message: "Hello #{req.name}" )
  end
end
server = Async::GRPC::Server.new()
server.handle(MyService)
server.start

FAQs

Package last updated on 02 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc