Skip to content

Use context consistently when it is part of a struct #513

@ChuntaoLu

Description

@ChuntaoLu

Context is sometimes attached to request struct (e.g. https://github.com/uber/zanzibar/blob/master/runtime/tchannel_server.go#L202) and is supposed to be used as the context for the request, but context is still passed in as a paramter to the methods whose receiver is the request (i.e., the request already have access to the context). This makes it possible that a request method uses a different context from the one it holds, e.g. https://github.com/uber/zanzibar/blob/master/runtime/tchannel_server.go#L246-L249. For structs that hold context internally, context should not be an argument to its methods.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions