Skip to content

Commit

Permalink
Update docs with the details of multiple HTTPProviders (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes authored Mar 22, 2023
1 parent 29d7af6 commit f2b9fcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ HTTPProvider
>>> from web3 import Web3
>>> w3 = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))
Note that you should create only one HTTPProvider per python
process, as the HTTPProvider recycles underlying TCP/IP network connections,
for better performance.
Note that you should create only one HTTPProvider with the same provider URL
per python process, as the HTTPProvider recycles underlying TCP/IP
network connections, for better performance. Multiple HTTPProviders with different
URLs will work as expected.

Under the hood, the ``HTTPProvider`` uses the python requests library for
making requests. If you would like to modify how requests are made, you can
Expand Down
1 change: 1 addition & 0 deletions newsfragments/2889.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add doc blurb about multiple HTTPProviders with the same URL

1 comment on commit f2b9fcd

@miohtama
Copy link
Contributor

@miohtama miohtama commented on f2b9fcd Mar 23, 2023

Choose a reason for hiding this comment

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

@kclowes Sphinx has special note tag you can use here.

.. note ::

    You should create only one HTTPProvider with the same provider URL
    process, as the HTTPProvider recycles underlying TCP/IP network connections,
    per python process, as the HTTPProvider recycles underlying TCP/IP
    for better performance.
    network connections, for better performance. Multiple HTTPProviders with different
    URLs will work as expected.

Please sign in to comment.