-
Notifications
You must be signed in to change notification settings - Fork 307
Open
Description
Now batch call look like:
rpc.batch(function() { /* add some request to rpc */ }, function() { /* request callback */ })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 be null and rpc 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:
rpc.createBatch() // create copy of rpc instance and set batchedCalls as empty array
.getRawTransaction(txid1) // put request to batchedCalls
.getRawTransaction(txid2) // put request to batchedCalls
.call(function() { /* request callback */ }) // make requestI'm not sure about createBatch, call and hope somebody offer more suitable names.
Metadata
Metadata
Assignees
Labels
No labels