ipfs / go-bitswap

The golang implementation of the bitswap protocol
MIT License
216 stars 112 forks source link

chore: rewrite ProviderQueryManager and rename to ProviderQueryer #575

Closed guseggert closed 1 year ago

guseggert commented 2 years ago

This renames ProviderQueryManager to ProviderQueryer to more clearly reflect what it does.

It also rewrites it to remove the need for running a goroutine pool. Instead, concurrency is limited using a semaphore and locks are used to ensure that only a single query happens under concurrent requests for the same CID. This simplifies the code, makes reading stack traces easier, and removes the need for lifecycle management of the queryer (the only resources that need to be shut down are done so by the request context).

Some other minor changes:

Jorropo commented 1 year ago

This repository has been moved to https://github.com/ipfs/go-libipfs. There is not an easy way to transfer PRs, so if you would like to continue with this PR then please re-open it in the new repository and link to this PR.