Improve client stream server side stub
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 17h
- PR unite (30g)
- 37
Descrizione
Looking at this:
https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java#L187
This is super weird to have the "request input", Points, as a return value of a method, and the response RouteSummary, to be the input parameter of a method. I took a look at this for a while to figure out what's going on. I see it is forcing the implementation of StreamObserver interface to process the incoming Points, and thus requiring it to be a return value. I wonder if there is a better way of doing this.
Every other language stubs seems to generate sensible stubs where the input steam is in fact the parameter and not a return value, and they actually returns the actual RouteSummary as the return value of the method.
https://github.com/grpc/grpc-go/blob/master/examples/route_guide/server/server.go#L102
https://github.com/grpc/grpc/blob/master/examples/node/route_guide/route_guide_server.js#L156
https://github.com/grpc/grpc/blob/master/examples/python/route_guide/route_guide_server.py#L93
https://github.com/grpc/grpc/blob/master/examples/ruby/route_guide/route_guide_server.rb#L144
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’implementazione dello streaming lato server in examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java intorno alla riga 187, quindi confronta i server route guide in Go, Node, Python e Ruby collegati nell’issue. Determina se l’API dello stub Java può esporre il request stream e RouteSummary in modo più naturale; il lavoro è completo quando sono disponibili un design concordato e i corrispondenti aggiornamenti agli stub generati e all’esempio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- grpc, java
- Ambito
- api, backend-api-design
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100