responsemanager

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT, Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHooks

type BlockHooks interface {
	ProcessBlockHooks(p peer.ID, request graphsync.RequestData, blockData graphsync.BlockData) hooks.BlockResult
}

BlockHooks is an interface for processing block hooks

type BlockSentListeners

type BlockSentListeners interface {
	NotifyBlockSentListeners(p peer.ID, request graphsync.RequestData, block graphsync.BlockData)
}

BlockSentListeners is an interface for notifying listeners that of a block send occuring over the wire

type CancelledListeners

type CancelledListeners interface {
	NotifyCancelledListeners(p peer.ID, request graphsync.RequestData)
}

CancelledListeners is an interface for notifying listeners that requestor cancelled

type CompletedListeners

type CompletedListeners interface {
	NotifyCompletedListeners(p peer.ID, request graphsync.RequestData, status graphsync.ResponseStatusCode)
}

CompletedListeners is an interface for notifying listeners that responses are complete

type NetworkErrorListeners

type NetworkErrorListeners interface {
	NotifyNetworkErrorListeners(p peer.ID, request graphsync.RequestData, err error)
}

NetworkErrorListeners is an interface for notifying listeners that an error occurred sending a data on the wire

type PeerManager

type PeerManager interface {
	SenderForPeer(p peer.ID) peerresponsemanager.PeerResponseSender
}

PeerManager is an interface that returns sender interfaces for peer responses.

type QueryQueue

type QueryQueue interface {
	PushTasks(to peer.ID, tasks ...peertask.Task)
	PopTasks(targetMinWork int) (peer.ID, []*peertask.Task, int)
	Remove(topic peertask.Topic, p peer.ID)
	TasksDone(to peer.ID, tasks ...*peertask.Task)
	ThawRound()
}

QueryQueue is an interface that can receive new selector query tasks and prioritize them as needed, and pop them off later

type RequestHooks

type RequestHooks interface {
	ProcessRequestHooks(p peer.ID, request graphsync.RequestData) hooks.RequestResult
}

RequestHooks is an interface for processing request hooks

type ResponseManager

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

ResponseManager handles incoming requests from the network, initiates selector traversals, and transmits responses

func New

func New(ctx context.Context,
	loader ipld.Loader,
	peerManager PeerManager,
	queryQueue QueryQueue,
	requestHooks RequestHooks,
	blockHooks BlockHooks,
	updateHooks UpdateHooks,
	completedListeners CompletedListeners,
	cancelledListeners CancelledListeners,
	blockSentListeners BlockSentListeners,
	networkErrorListeners NetworkErrorListeners,
	maxInProcessRequests uint64,
) *ResponseManager

New creates a new response manager from the given context, loader, bridge to IPLD interface, peerManager, and queryQueue.

func (*ResponseManager) CancelResponse

func (rm *ResponseManager) CancelResponse(p peer.ID, requestID graphsync.RequestID) error

CancelResponse cancels an in progress response

func (*ResponseManager) PauseResponse

func (rm *ResponseManager) PauseResponse(p peer.ID, requestID graphsync.RequestID) error

PauseResponse pauses an in progress response (may take 1 or more blocks to process)

func (*ResponseManager) ProcessRequests

func (rm *ResponseManager) ProcessRequests(ctx context.Context, p peer.ID, requests []gsmsg.GraphSyncRequest)

ProcessRequests processes incoming requests for the given peer

func (*ResponseManager) Shutdown

func (rm *ResponseManager) Shutdown()

Shutdown ends processing for the want manager.

func (*ResponseManager) Startup

func (rm *ResponseManager) Startup()

Startup starts processing for the WantManager.

func (*ResponseManager) UnpauseResponse

func (rm *ResponseManager) UnpauseResponse(p peer.ID, requestID graphsync.RequestID, extensions ...graphsync.ExtensionData) error

UnpauseResponse unpauses a response that was previously paused

type UpdateHooks

type UpdateHooks interface {
	ProcessUpdateHooks(p peer.ID, request graphsync.RequestData, update graphsync.RequestData) hooks.UpdateResult
}

UpdateHooks is an interface for processing update hooks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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