Provide non blocking getFlightInfo
- Langage dominant
- Java
- Étoiles
- 94
- Forks
- 152
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 11
Description
### 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;
}
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par lire l’interface FlightProducer et la gestion de getFlightInfo par FlightService, puis comparez la manière dont les autres méthodes non bloquantes de FlightProducer sont implémentées. Vérifiez comment la surcharge de listener proposée et l’indicateur isBlockingFlightInfo peuvent préserver les implémentations existantes ; le travail est terminé lorsque FlightService peut utiliser le chemin non bloquant sans casser les producteurs bloquants.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100