Add tags to calls, including computable tags by swankjesse · Pull Request #9168 · square/okhttp (original) (raw)
Originally I was planning on implementing tags on Request only, but that design broke as soon as any interceptor used Request.newBuilder() to create a copy of the Request - the instance that received the tags might not be the instance that needed them.
Instead I'm introducing this behavior on the Call object, which behaves less like a value. I expect that users' expected lifetimes of tags will work naturally this way.
It is an API hazard that we have tags on both Requests and Calls. Perhaps if given the opportunity to do it over, I'd omit support for tags on Requests.