Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderQueryManager ¶
type ProviderQueryManager struct {
// contains filtered or unexported fields
}
ProviderQueryManager manages requests to find more providers for blocks for bitswap sessions. It's main goals are to: - rate limit requests -- don't have too many find provider calls running simultaneously - connect to found peers and filter them if it can't connect - ensure two findprovider calls for the same block don't run concurrently - manage timeouts
func New ¶
func New(ctx context.Context, network ProviderQueryNetwork) *ProviderQueryManager
New initializes a new ProviderQueryManager for a given context and a given network provider.
func (*ProviderQueryManager) FindProvidersAsync ¶
func (pqm *ProviderQueryManager) FindProvidersAsync(sessionCtx context.Context, k cid.Cid) <-chan peer.ID
FindProvidersAsync finds providers for the given block.
func (*ProviderQueryManager) SetFindProviderTimeout ¶
func (pqm *ProviderQueryManager) SetFindProviderTimeout(findProviderTimeout time.Duration)
SetFindProviderTimeout changes the timeout for finding providers
func (*ProviderQueryManager) Startup ¶
func (pqm *ProviderQueryManager) Startup()
Startup starts processing for the ProviderQueryManager.