Giter VIP home page Giter VIP logo

Comments (4)

bianpengyuan avatar bianpengyuan commented on August 20, 2024

No we don't have one yet. We can add that.

from wasm-extensions.

NomadXD avatar NomadXD commented on August 20, 2024

@bianpengyuan yeah that would be great to have. I have a native C++ filter and I'm trying to re-implement it in WASM , so I don't have to build it everytime with bazel. I have some question regarding the grpc streaming APIs in proxy_wasm_api.h. Can I ask it here if you won't mind ?

from wasm-extensions.

bianpengyuan avatar bianpengyuan commented on August 20, 2024

I've never tried the gRPC stream API, so not sure how much I can help.

Meanwhile, I don't think bazel is quite avoidable when you write Wasm module with C++. Especially when you use protobuf / gRPC. Although Bazel based build for C++ Wasm extension is way easier than native Envoy filter.

from wasm-extensions.

NomadXD avatar NomadXD commented on August 20, 2024

@bianpengyuan yeah that's true. I just want to avoid the native envoy build. I actually want to have both native and WASM filters, so it's more flexible to have options. I'll just describe my question below, if you are familiar with it you can answer. So my filter needs to use the gRPC bidi streams to communicate with an external service. I want to create a stream per every filter object and use the stream to send data to the external service.

The WASM api has this following method will creates a stream and delegates the stream management to the GrpcStreamHanlder class.

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);

So we have to implement that class like ExampleGrpcStreamHanlder: public GrpcStreamHanlder<Request,Response> and implement relevant methods like onResponse(), onRemoteClose(). And if I want to send a message to the external service, I have to call the send() method in GrpcStreamHanlder. To call it from my filter I need to have some reference to GrpcStreamHanlder. In the C++ native filter, I pass the grpc client to the filter constructor. Here I'm not sure where I should pass that reference. Sorry if what i'm saying is not clear to you.

from wasm-extensions.

Related Issues (20)

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.