-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need Agent.get
?
#616
Comments
In a way I think we do, otherwise, we would have to reimplement it each time we extend from We would have to reimplement the |
Maybe, when we extend/create a custom Agent, we could let the developer provide a |
I’m just concerned with the public API for end users. |
The reason why we need Those things are deeply needed for observability and introspection. Removing access is not the solution. Overall I do not see the problem you are mentioning @ronag. If they use I think we might want to consider adding One thing I would change is that we might want to use a fresh Agent and not the globalAgent as the backing of the |
Ok, I think I might have a suggestion we can all agree on. Will open PR. |
* refactor: Client.clients & Agent is a Client. Refs: #616 * fixup: rename clientt to dispatcher * fixup: keep promise chain * fixup * fixup * fixup
* refactor: Client.clients & Agent is a Client. Refs: nodejs#616 * fixup: rename clientt to dispatcher * fixup: keep promise chain * fixup * fixup * fixup
I think
Agent.get
is a bit weird now that we haveAgent.dispatch
and adds unnecessary API surface.I know some of my colleagues use
Agent.get
directly instead of the helper methods (they want to useClient.dispatch
). I could easily see that they would get confused and start usingRedirectAgent.get
(they would assume they can just replaceAgent
withRedirectAgent
in existing code) thinking it does something it does not. Most people are not very meticulous with reading the docs and/or release notes.Refs: #603 (comment)
I know @mcollina has some use cases in mind though. Could you maybe expand a bit on those?
The text was updated successfully, but these errors were encountered: