Skip to content

Commit 3909a5a

Browse files
committed
Improve the batch requests documentation.
1 parent 4d88301 commit 3909a5a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docs/web3.main.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ Batch Requests
120120
121121
.. note::
122122

123-
Only read-only operations are supported by ``batch_requests``.
123+
Only read-only operations that exist within modules on the ``Web3`` class
124+
(e.g. ``w3.eth``, ``w3.net``) are supported by ``batch_requests``.
124125
Unsupported methods include:
125126

126127
- :meth:`subscribe <web3.eth.Eth.subscribe>`
@@ -130,13 +131,19 @@ Batch Requests
130131
- :meth:`sign_transaction <web3.eth.Eth.sign_transaction>`
131132
- :meth:`sign <web3.eth.Eth.sign>`
132133
- :meth:`sign_typed_data <web3.eth.Eth.sign_typed_data>`
134+
- ``w3.provider.make_request()``.
133135

134136
Async Batch Requests
135137
````````````````````
136138

137139
If using one of the asynchronous providers, you'll need to make use of
138-
the ``async_execute`` method and the ``async`` and ``await`` keywords
139-
as appropriate:
140+
the ``async_execute`` method and the ``async`` and ``await`` keywords as appropriate.
141+
142+
.. note::
143+
144+
If performance is a concern, consider using ``asyncio.gather()`` with single
145+
concurrent requests instead of an asynchronous batch request. It will generally be
146+
the faster option due to the overhead of batching.
140147

141148
.. code-block:: python
142149

newsfragments/3448.docs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve batch request documentation.

0 commit comments

Comments
 (0)