Skip to content

How do I best handle execing into a Pod in a namespace when watching with an Api::all instance? #722

Answered by clux
chinatsu asked this question in Q&A
Discussion options

You must be logged in to vote

hey there! glad you're getting things to work well. Cool idea for a project (and great name).

Cloning the Client or the Api should not be an operation that has noteworthy cost. It's designed so that it can be done pretty frequently in controllers because (as you have seen) you need one Api instance per scope (and also type) - so you are doing things idiomatically in my book.

The reasoning behind why cloning is cheap, lies in what the Client contains and how they are wrapped. The main interface to the http client goes through the tower::Service (or BoxService in our case), and it's wrapped in a tower::Buffer designed to cheaply clone services.

(There are some prototype thoughts floating ar…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chinatsu
Comment options

Answer selected by chinatsu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants