-
Notifications
You must be signed in to change notification settings - Fork 112
Enable custom task prioritization logic #535
Conversation
Thanks :). Can you add a test showing that this works? It can also serve as a useful example for people who want to leverage this option. |
@aschmahmann Sure, I can try, I thought about it but originally I didn't see any way to do black box testing of this functionality since it would have to somehow rely on timing. But I can probably do some sort of whitebox test that asserts on the order of PeerTasks popped from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nits about type accessibility, but othewise LGTM. In the future, we'll probably want to expose a peer comparator directly, but that shouldn't be a breakign change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Enable custom task prioritization logic This commit was moved from ipfs/go-bitswap@b35a29b
This is the second part of ipfs/boxo#82.
It introduces a
TaskComparator
which can be configured to implement custom task prioritization logic.