martinberoiz commented on issue #17325:
URL: https://github.com/apache/arrow/issues/17325#issuecomment-1642615425

   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:
   
   ```javascript
   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.
   


-- 
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]

Reply via email to