Giter VIP home page Giter VIP logo

grpc's People

Contributors

cabol avatar caotao avatar cmullaparthi avatar srenatus avatar tsloughter avatar vonmixer avatar willemdj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpc's Issues

Failed to create stream

Following the tutorial I try to run my own service and get an error. What could I have done wrong?

{ok, Connection} = grpc_client:connect(tcp, "localhost", 10000).
{ok, Stream} = grpc_client:new_stream(Connection, 'Send', 'SendMessage', speak).

** exception error: no match of right hand side value {error,<<"failed to create stream">>}

speak.proto

syntax = "proto3";

  option java_multiple_files = true;

package Send;

service Send {

rpc SendMessage(Message) returns (readReciept) {}

}

message Message {

string messageContent = 1;

}

message readReciept {

string reciept = 1;

}

speak_client.erl

-module(speak_client).

%% this file was generated by grpc

-export(['SendMessage'/3]).

-type 'Message'() ::
    #{messageContent => string()}.

-type readReciept() ::
    #{reciept => string()}.

-export_type(['Message'/0,
              readReciept/0]).

-spec decoder() -> module().
%% The module (generated by gpb) used to encode and decode protobuf
%% messages.
decoder() -> speak.

%% RPCs for service 'Send'

-spec 'SendMessage'(
        Connection::grpc_client:connection(),
        Message::'Message'(),
        Options::[grpc_client:stream_option() |
                  {timeout, timeout()}]) ->
        grpc_client:unary_response(readReciept()).
%% This is a unary RPC
'SendMessage'(Connection, Message, Options) ->
    grpc_client:unary(Connection, Message,
                      'Send', 'SendMessage',
                       decoder(), Options).

Access bidirectional stream from outside

I have 2 connections and in each connection bidirectional streams and when the client from the first connection sends something to sever I want to forward it to client from the second connection. How to access the other connection if I eg know both processes PIDs form ets table?

there is a question about "README.md"

start the server example "grpc:start_server(hello, tcp, 10000, helloworld_server, [])." it should be "grpc:start_server(hello,tcp,10000,#{'ServiceName'=> helloworld_server},[])."

Hardcoded headers/metadata

There are headers that shouldn't be hard coded, because of this is not possible to consume external gRPC APIs, for example Google Services (in my case Spanner).

These are some of them:

Don't know if make sense but other solution (which could be useful for some cases) might be allowing headers overriding the headers, using the metadata (merge both proplists instead of append them - https://github.com/Bluehouse-Technology/grpc/blob/master/src/grpc_client_lib.erl#155) – this was the workaround I did to make it work against Google, but not sure if it is the right way.

Stay tuned! Thanks!!

Multiple service handlers

I'm working on some changes and wanted to run the changes by you before getting to far.

The issue I was dealing with was wanting to host multiple services handled by different modules from the same server port. Currently the grpc app only accepts 1 module name.

Here is the example converted to what I'm thinking:

> {ok, Server} = grpc:start_server(grpc, tcp, 10000, [#{service => route_guide,
                                                        defs_module => route_guide,
                                                        handler => route_guide_server_1}]).

This would also remove the need for the function decoder() -> route_guide.

How to map java package?

I use proto file generate a java server, then use same file to generate erlang grpc module, but I can't fond a option to specific "package" instead erlang "module"?

%% This is a unary RPC
onConnect(Connection, Message, Options) ->
    grpc_client:unary(Connection, Message,
                      'RequestHandler', onConnect,
                       decoder(), Options).

Such example, my java package is com.test.RequestHandler.java, When I generate the entire package it not appear.
I need this:

onConnect(Connection, Message, Options) ->
    grpc_client:unary(Connection, Message,
                      'com.test.RequestHandler', onConnect,
                       decoder(), Options).

It is my proto file(test.proto):

syntax = "proto3";

option java_package = "com.test";
option java_outer_classname = "Types";

package grpcserver;
//---------------------------
message AuthRequest{
  string clientId = 1;
  string username = 2;
  string password = 3;
}
//....

How can I config package?

Cowboy issues

@willemdj Hi,

I saw your thread on HTTP/2 features in cowboy. I have been working on an HTTP/2 server. It is clearly not as mature as cowboy but was developed HTTP/2 first so might be more useful for a GRPC foundation. The possible downside from your point of view is at the moment it is in Elixir. I haven't yet worked out how to use an Elixir lib in erlang but I would certainly like to set that up.

Quick summary of the issues you raised here ninenines/cowboy#1191

  • It does send trailers
  • it makes some assumptions about the headers sent when falling back to HTTP/1 but none about what is sent over HTTP/2 so there are no date and server headers by default
  • The peer certificate could be more tricky, but I am currently looking at how to expose more information about the connection.
  • headers are a list so ordering should be fine
  • flow control, that is a feature I am trying to hold off on until after 1.0 to limit workload.

grpc for web

Is the library compatible for gprc web client? If not, any ideas?

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.