asyncloader

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncLoader

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

AsyncLoader manages loading links asynchronously in as new responses come in from the network

func New

func New(ctx context.Context, loader ipld.Loader, storer ipld.Storer) *AsyncLoader

New initializes a new link loading manager for asynchronous loads from the given context and local store loading and storing function

func (*AsyncLoader) AsyncLoad

func (al *AsyncLoader) AsyncLoad(requestID graphsync.RequestID, link ipld.Link) <-chan types.AsyncLoadResult

AsyncLoad asynchronously loads the given link for the given request ID. It returns a channel for data and a channel for errors -- only one message will be sent over either.

func (*AsyncLoader) CleanupRequest

func (al *AsyncLoader) CleanupRequest(requestID graphsync.RequestID)

CleanupRequest indicates the given request is complete on the client side, and no further attempts will be made to load links for this request, so any cached response data is invalid can be cleaned

func (*AsyncLoader) CompleteResponsesFor

func (al *AsyncLoader) CompleteResponsesFor(requestID graphsync.RequestID)

CompleteResponsesFor indicates no further responses will come in for the given requestID, so if no responses are in the cache or local store, a link load should not retry

func (*AsyncLoader) ProcessResponse

func (al *AsyncLoader) ProcessResponse(responses map[graphsync.RequestID]metadata.Metadata,
	blks []blocks.Block)

ProcessResponse injests new responses and completes asynchronous loads as neccesary

func (*AsyncLoader) Shutdown

func (al *AsyncLoader) Shutdown()

Shutdown finishes processing of messages

func (*AsyncLoader) StartRequest

func (al *AsyncLoader) StartRequest(requestID graphsync.RequestID)

StartRequest indicates the given request has started and the manager should continually attempt to load links for this request as new responses come in

func (*AsyncLoader) Startup

func (al *AsyncLoader) Startup()

Startup starts processing of messages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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