Skip to content
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

feat: make dispatcher truly global #1405

Merged
merged 5 commits into from
May 4, 2022
Merged

feat: make dispatcher truly global #1405

merged 5 commits into from
May 4, 2022

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented May 3, 2022

Fixes #1331

@mcollina mcollina requested review from targos and ronag May 3, 2022 10:27
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2022

Codecov Report

Merging #1405 (fcb7dad) into main (c3da945) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1405   +/-   ##
=======================================
  Coverage   94.28%   94.29%           
=======================================
  Files          47       48    +1     
  Lines        4250     4256    +6     
=======================================
+ Hits         4007     4013    +6     
  Misses        243      243           
Impacted Files Coverage Δ
index.js 100.00% <100.00%> (ø)
lib/global.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3da945...fcb7dad. Read the comment docs.

@mcollina mcollina requested a review from delvedor May 4, 2022 07:50
Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I still think it would be useful to encode in the global dispatcher the version, even if we are not using it right now.
In this case if in the future there is the need to do a breaking change, we already have the code to handle it.

@mcollina
Copy link
Member Author

mcollina commented May 4, 2022

@delvedor done.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina mcollina merged commit c128d13 into main May 4, 2022
@mcollina mcollina deleted the global-agent2 branch May 4, 2022 08:26
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* Make the dispatcher truly global

* make sure the global dispatcher is used for Node.js fetch

* Fix test

* added version number
@djmadeira
Copy link

@delvedor @mcollina this doesn't seem to work. It works fine when using undici's fetch, but elasticsearch uses a pool, which doesn't seem to pick up the global dispatcher at all. Any thoughts on a fix?

@mcollina
Copy link
Member Author

@delvedor uses a pool, so it's bypassing this system. I'd recommend the ES client to accept an undici dispatcher as an option.

metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
* Make the dispatcher truly global

* make sure the global dispatcher is used for Node.js fetch

* Fix test

* added version number
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* Make the dispatcher truly global

* make sure the global dispatcher is used for Node.js fetch

* Fix test

* added version number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the global dispatcher truly global
6 participants