envoyproxy/envoy

Clarify StreamInfo::route API

Open

#10,972 创建于 2020年4月28日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)C++ (5,373 fork)batch import
area/httphelp wantedtech debt

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

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.

贡献者指南