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

fix: unify Pool and Client APIs #544

Merged
merged 7 commits into from
Feb 10, 2021
Merged

fix: unify Pool and Client APIs #544

merged 7 commits into from
Feb 10, 2021

Conversation

ronag
Copy link
Member

@ronag ronag commented Feb 10, 2021

  • 'connect' and 'disconnect' event should have same arguments.
  • connected should be an integer

@ronag ronag added the semver-major Features or fixes that will be included in the next semver major release label Feb 10, 2021
@ronag
Copy link
Member Author

ronag commented Feb 10, 2021

This allows e.g. using Agent with Client instead of Pool. So if connections === 1 we could fallback to Client and avoid the overhead of Pool.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

This needs tests

@ronag ronag requested a review from mcollina February 10, 2021 11:50
@ronag
Copy link
Member Author

ronag commented Feb 10, 2021

test added

- 'connect' and 'disconnect' event should have same arguments.
- connected should be an integer
@codecov-io
Copy link

codecov-io commented Feb 10, 2021

Codecov Report

Merging #544 (acb266d) into master (889850e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #544   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files          16       16           
  Lines        1386     1387    +1     
=======================================
+ Hits         1380     1381    +1     
  Misses          6        6           
Impacted Files Coverage Δ
lib/agent.js 100.00% <100.00%> (ø)
lib/core/client.js 99.46% <100.00%> (ø)
lib/pool.js 99.25% <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 cb25b52...03c743a. Read the comment docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag merged commit 8d9e606 into master Feb 10, 2021
@ronag ronag deleted the unify-pool-client branch February 10, 2021 13:51
@ronag ronag mentioned this pull request Feb 18, 2021
@Ethan-Arrowood
Copy link
Collaborator

I'm going to update my docs PR to include these changes now too

Ethan-Arrowood added a commit to Ethan-Arrowood/undici that referenced this pull request Feb 18, 2021
ronag pushed a commit that referenced this pull request Feb 21, 2021
* start new docs pages following style guide

* scaffold Client and start filling in

* slight tweaks

* add alt overload syntax

* add destroy and dispatch

* rename interface to parameter

* more style guide and add request method

* complete client section

* move style-guide to mddl

* Complete Client.dispatch

* add example to constructor

* complete client.close

* Complete client.connect

* finish destroy method

* add request docs

* add examples to request

* complete stream method

* complete upgrade and pipeline sections

* remove some files

* try alt callback overload style

* remove redundant async

* remove fastify dep and add catch to upgrade example

* change callback/promise style

* complete incomplete example

* remove redundant callback description

* improve event sections

* complete events examples

* improve stream example

* change stream example, reorder dispatch sections

* fix #544 changes

* complete Dispatch Upgrade request example

* review pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major Features or fixes that will be included in the next semver major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants