responsemanager

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0, MIT Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockSentListeners added in v0.3.0

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 added in v0.1.0

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

CancelledListeners is an interface for notifying listeners that requestor cancelled

type CompletedListeners added in v0.1.0

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 added in v0.3.0

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 RequestCloser added in v0.10.2

type RequestCloser interface {
	TerminateRequest(requestID graphsync.RequestID)
	CloseWithNetworkError(requestID graphsync.RequestID)
}

RequestCloser can cancel request on a network error

type RequestHooks added in v0.1.0

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

RequestHooks is an interface for processing request hooks

type RequestProcessingListeners added in v0.14.0

type RequestProcessingListeners interface {
	NotifyRequestProcessingListeners(p peer.ID, request graphsync.RequestData, inProgressRequestCount int)
}

RequestProcessingListeners is an interface for notifying listeners a request has begun processing

type ResponseAssembler added in v0.6.0

type ResponseAssembler interface {
	NewStream(ctx context.Context, p peer.ID, requestID graphsync.RequestID, subscriber notifications.Subscriber) responseassembler.ResponseStream
}

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

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,
	linkSystem ipld.LinkSystem,
	responseAssembler ResponseAssembler,
	requestProcessingListeners RequestProcessingListeners,
	requestHooks RequestHooks,
	updateHooks UpdateHooks,
	completedListeners CompletedListeners,
	cancelledListeners CancelledListeners,
	blockSentListeners BlockSentListeners,
	networkErrorListeners NetworkErrorListeners,
	connManager network.ConnManager,
	maxLinksPerRequest uint64,
	panicCallback panics.CallBackFn,
	responseQueue taskqueue.TaskQueue,
) *ResponseManager

New creates a new response manager for responding to requests

func (*ResponseManager) CancelResponse added in v0.1.0

func (rm *ResponseManager) CancelResponse(ctx context.Context, requestID graphsync.RequestID) error

CancelResponse cancels an in progress response

func (*ResponseManager) CloseWithNetworkError added in v0.10.2

func (rm *ResponseManager) CloseWithNetworkError(requestID graphsync.RequestID)

CloseWithNetworkError closes a request due to a network error

func (*ResponseManager) FinishTask added in v0.10.0

func (rm *ResponseManager) FinishTask(task *peertask.Task, p peer.ID, err error)

FinishTask marks a task from the task queue as done

func (*ResponseManager) GetUpdates added in v0.10.0

func (rm *ResponseManager) GetUpdates(requestID graphsync.RequestID, updatesChan chan<- []gsmsg.GraphSyncRequest)

GetUpdates is called to read pending updates for a task and clear them

func (*ResponseManager) PauseResponse added in v0.1.0

func (rm *ResponseManager) PauseResponse(ctx context.Context, requestID graphsync.RequestID) error

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

func (*ResponseManager) PeerState added in v0.10.7

func (rm *ResponseManager) PeerState(p peer.ID) peerstate.PeerState

PeerState gets current state of the outgoing responses for a given peer

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) StartTask added in v0.10.0

func (rm *ResponseManager) StartTask(task *peertask.Task, p peer.ID, responseTaskChan chan<- queryexecutor.ResponseTask)

StartTask starts the given task from the peer task queue

func (*ResponseManager) Startup

func (rm *ResponseManager) Startup()

Startup starts processing for the WantManager.

func (*ResponseManager) TerminateRequest added in v0.10.8

func (rm *ResponseManager) TerminateRequest(requestID graphsync.RequestID)

TerminateRequest indicates a request has finished sending data and should no longer be tracked

func (*ResponseManager) UnpauseResponse added in v0.1.0

func (rm *ResponseManager) UnpauseResponse(ctx context.Context, requestID graphsync.RequestID, extensions ...graphsync.ExtensionData) error

UnpauseResponse unpauses a response that was previously paused

func (*ResponseManager) UpdateResponse added in v0.13.0

func (rm *ResponseManager) UpdateResponse(ctx context.Context, requestID graphsync.RequestID, extensions ...graphsync.ExtensionData) error

UpdateRequest updates an in progress response

type UpdateHooks added in v0.1.0

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
Package responseassembler assembles responses that are queued for sending in outgoing messages
Package responseassembler assembles responses that are queued for sending in outgoing messages

Jump to

Keyboard shortcuts

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