loadattemptqueue

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadAttemptQueue

type LoadAttemptQueue struct {
	// contains filtered or unexported fields
}

LoadAttemptQueue attempts to load using the load attempter, and then can place requests on a retry queue

func New

func New(loadAttempter LoadAttempter) *LoadAttemptQueue

New initializes a new AsyncLoader from loadAttempter function

func (*LoadAttemptQueue) AttemptLoad

func (laq *LoadAttemptQueue) AttemptLoad(lr LoadRequest, retry bool)

AttemptLoad attempts to loads the given load request, and if retry is true it saves the loadrequest for retrying later

func (*LoadAttemptQueue) ClearRequest

func (laq *LoadAttemptQueue) ClearRequest(requestID graphsync.RequestID)

ClearRequest purges the given request from the queue of load requests to retry

func (*LoadAttemptQueue) RetryLoads

func (laq *LoadAttemptQueue) RetryLoads()

RetryLoads attempts loads on all saved load requests that were loaded with retry = true

type LoadAttempter

type LoadAttempter func(peer.ID, graphsync.RequestID, ipld.Link, ipld.LinkContext) types.AsyncLoadResult

LoadAttempter attempts to load a link to an array of bytes and returns an async load result

type LoadRequest

type LoadRequest struct {
	// contains filtered or unexported fields
}

LoadRequest is a request to load the given link for the given request id, with results returned to the given channel

func NewLoadRequest

func NewLoadRequest(
	p peer.ID,
	requestID graphsync.RequestID,
	link ipld.Link,
	linkContext ipld.LinkContext,
	resultChan chan types.AsyncLoadResult) LoadRequest

NewLoadRequest returns a new LoadRequest for the given request id, link, and results channel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL