pbower commented on issue #17325: URL: https://github.com/apache/arrow/issues/17325#issuecomment-2167081280
> Hello, I am also in this same situation. I made a small grpc-web demo (you can take a look here https://git.ligo.org/martin.beroiz/grpc-demo) and I'm now expanding it to replace the grpc server to an arrow flight server. > > The server side works as intended without much change, but I'm struggling on the browser side. I compiled the arrow flight protobuf's and included them in the web app (I can upload a work-in-progress repo if anyone is interested) > > The client.js side looks a bit like this: > > ```js > import { HandshakeRequest, Criteria } from "./arrow_pb.js"; > import { FlightServiceClient } from "./arrow_grpc_web_pb.js"; > > var myFlightService = new FlightServiceClient("http://localhost:8080"); > > $(document).ready(function () { > $("#send-button").on("click", async function (e) { > e.preventDefault(); > > var request = new HandshakeRequest(); > var criteria = new Criteria(); > > myFlightService.listFlights(request, criteria).then((err, response) => { > if (err) { > console.log(err); > } > console.log(response); > }); > }); > }); > ``` > > This doesn't work mainly because I don't know much about calling flight from a client in general. > > 1. the function listFlight requires a `request` argument that I don't know how to create > > 2. I have no idea what `myFlightService.listFlight` returns (a promise?) or how to deal with it to get a response and unpack the data after > > > A short example with a `do_get` request or something of the sort could help tremendously. Hopefully this will help someone move forward with a working example. Hi, I'm wondering how you went with this ? I'm also looking for a flight RPC JS browser option. Have been looking into Rust WebAssembly too but the compilation and package dependencies for tonic, tokio, socket2 and mio are causing grief. If you cracked it I'd love to hear how you did it. Thanks!! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
