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

Add batch requests #304

Merged
merged 10 commits into from
Oct 13, 2022
Merged

Add batch requests #304

merged 10 commits into from
Oct 13, 2022

Conversation

kevinheavey
Copy link
Collaborator

Adds methods for sending and parsing RPC batch requests. Also adds make_request_unparsed which acts as an escape hatch if the user doesn't want their responses parsed.

The weird stuff I did with @overload is there because Python type hints don't have a better way of saying "I passed a tuple of parser classes and so I expect to return a tuple of instances of these classes." I added overloads for up to six request objects per batch. We can add more if somebody wants them but I think six is plenty as RPC providers have limits etc.

Kevin Heavey added 2 commits October 12, 2022 23:08
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #304 (ff80cfe) into master (55b91a9) will decrease coverage by 0.55%.
The diff coverage is 82.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   90.87%   90.31%   -0.56%     
==========================================
  Files          34       34              
  Lines        2421     2551     +130     
==========================================
+ Hits         2200     2304     +104     
- Misses        221      247      +26     

@kevinheavey kevinheavey merged commit 5afdda6 into master Oct 13, 2022
@kevinheavey kevinheavey deleted the batch-requests branch October 13, 2022 07:07
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.

2 participants