-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gRPC streaming with envoy wasm #1
Comments
what's so confusing is MyGrpcCallStreamHandler streamHandler_ = new MyGrpcCallStreamHandler(this);
auto res = root()->grpcStreamHandler(grpc_service_string, EchoServerServiceName,EchoMethodName, initial_metadata,std::unique_ptr<GrpcStreamHandlerBase>(streamHandler_));
from onCreate in context. and then implement some methods in |
I would be so thankful if you can provide a sample code snippet since there's no any other examples related to this and I'm blocked here for couple of days. |
i really don't know cpp that well at all to construct a sample but you would use grpcStreamHandler() as the way to get this done. what i'm not sure which mode you need (server,client or bidi) but that function should be the thing to use. i know go better so i'm going to update this snippet once proy-wasm-go-sdk#14 is addressed |
For me the issue is not with using grpcStreamHandler(). See these 2 method definitions for example. WasmResult grpcCallHandler(std::string_view service, std::string_view service_name,
std::string_view method_name,
const HeaderStringPairs &initial_metadata, std::string_view request,
uint32_t timeout_milliseconds,
std::unique_ptr<GrpcCallHandlerBase> handler);
And for the streamHandler() WasmResult grpcStreamHandler(std::string_view service, std::string_view service_name,
std::string_view method_name,
const HeaderStringPairs &initial_metadata,
std::unique_ptr<GrpcStreamHandlerBase> handler); For unary calls, that method directly sends the request. But for streams that method just create a stream and we have to implement another class by inheriting from GrpcStreamHandler and use their send() method to send a request. class MyGrpcCallStreamHandler : public GrpcStreamHandler<google::protobuf::Value, google::protobuf::Value> What I don't understand is how to call that method from the filter class. For the native filter I pass a reference to StreamHandler in the constructor of the filter. Here I'm not sure where to pass that. Maybe from on the onCreate() method of the filter. Thanks for the response. |
Thanks a lot for the example of envoy wasm filter with gRPC unary request. Have you tried it with gRPC streaming ? In the proto file, you have defined a server streaming service but couldn't find any implementation. I'm trying to use gRPC bidi streaming. I have a native C++ filter that I want to re-implement as WASM.
The text was updated successfully, but these errors were encountered: