envoyproxy/envoy

Clarify StreamInfo::route API

Open

#10.972 geöffnet am 28. Apr. 2020

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/httphelp wantedtech debt

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Currently StreamInfo::route overloads two concepts: looking up the route and re-resolving the route. We should consider splitting this into

RouteConstSharedPtr route() const;
RouteConstSharedPtr resolveRoute();

to distinguish between a lookup and an intentional re-resolution of the route. route() would still have to resolve the route in case it hasn't been resolved, but at the very least this simplifies

callbacks_.clearRouteCache();
auto route = callbacks_.route();
// Act on route.

into

auto route = callbacks_.resolveRoute();
// Act on route.

and the semantics of the two functions are more obvious at a glance.

Contributor Guide