Conversation
|
Hey, re-try mechanism sounds good. But I am not sure if we need
Instead of code changes, try change 10 to for example 1. It can be passed as parameter. Although re-try has it own value. Let me know if it works for you. |
Thanks for the review. That's what I first thought, just changing the value to 1 would just use 1 processor and everything would be sequential. However this wasn't the case. Contrary to the logic, changing the value to 1 would still run 3 processes in parallel, so I end up implementing the additional -sequential functions you see. |
|
There is caveat of this even with So there is a flow: So: To summary this up:
The number 3 is about buffer (queue), not parallel or concurrency processing. At least this is how it works in Java world. |
|
This can help understanding how it works under the hood:
|
569d7e7 to
4a3a1cf
Compare
kwladyka
left a comment
There was a problem hiding this comment.
Feel free to use your version or mine https://github.com/district0x/district-server-smart-contracts/pull/34/files
Notice I also changed
if (:error? (meta log))
(callback log nil)
which was a bug.
Please fix it also in your version if you decide to merge yours.
Some web3 providers force rate limits such that the amount of request you can do per second is capped. In that case, the provider sends an error if many requests are done in very short time.
This pull requests implements a retry mechanism with exponential backoff in case an error is received from the provider.
Additionally, a config parameter has been added to allow fetching the events sequentially to limit the amount of requests. That is, a request is not attempted until previous one is completed.