-
Notifications
You must be signed in to change notification settings - Fork 315
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
Batch interface suggestion #9
Comments
I agree that the interface can be improved, and I like your suggestion. I'd personally prefer:
or a more promise-oriented version:
do you want to try and implement this in a PR (either of the versions)? |
The batch API for levelup I think makes a fair amount of sense: |
Promise not good idea here, because except batch bitcoind-rpc have other many methods.. and we should stick one style: callbacks everywhere or promise everywhere. |
FYI, I wrote my own bitcoind rpc driver with batch behavior described here, you can see code here |
Now
batch
call look like:I think it's not good, why I must write yet one function for filling
rpc.batchedCalls
?And what really important, what happened if we get an exception in first function? When we try make new request (
getInfo
for example),batchedCalls
not benull
andrpc
instance will be considered that we fill batch request... so, it's broke all rpc instance!I suggest replaced batch request by something like this:
I'm not sure about
createBatch
,call
and hope somebody offer more suitable names.The text was updated successfully, but these errors were encountered: