Provide non blocking getFlightInfo
- Lenguaje dominante
- Java
- Estrellas
- 94
- Forks
- 152
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 11
Descripción
### Describe the enhancement requested
We have a use case in our production environment where getFlightInfo can take longer than a second and having a blocking getFlightInfo is a problem. Since many other methods in FlightProducer is non blocking we should also have a non blocking getFlightInfo
The code would look something like this with minimum impact to all the implementations
```
/**
* Get information about a particular data stream.
*
* @param context Per-call context.
* @param descriptor The descriptor identifying the data stream.
* @return Metadata about the stream.
*/
FlightInfo getFlightInfo(CallContext context, FlightDescriptor descriptor);
/**
* Get information about a particular data stream.
*
* @param context Per-call context.
* @param descriptor The descriptor identifying the data stream.
* @param listener An interface for sending data back to the client.
*/
default void getFlightInfo(CallContext context, FlightDescriptor descriptor, StreamListener listener ){
FlightInfo flightInfo = getFlightInfo(context, descriptor);
listener.onNext(flightInfo);
listener.onCompleted();
}
/**
*
* @return true if blocking (default) version of getFlightInfo needs to be used by FlightService.
*/
default boolean isBlockingFlightInfo() {
return true;
}
```
Guía de contribución
Línea de trabajo
Comienza leyendo la interfaz FlightProducer y cómo FlightService gestiona getFlightInfo; después, compara cómo están implementados los otros métodos no bloqueantes de FlightProducer. Confirma cómo la sobrecarga de listener propuesta y el indicador isBlockingFlightInfo pueden preservar las implementaciones existentes; el trabajo estará terminado cuando FlightService pueda usar la ruta no bloqueante sin romper los productores bloqueantes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100