sessioninterestmanager

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionInterestManager

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

SessionInterestManager records the CIDs that each session is interested in.

func New

New initializes a new SessionInterestManager.

func (*SessionInterestManager) FilterSessionInterested

func (sim *SessionInterestManager) FilterSessionInterested(ses uint64, ksets ...[]auth.Want) [][]auth.Want

The session calls FilterSessionInterested() to filter the sets of keys for those that the session is interested in

func (*SessionInterestManager) InterestedSessions

func (sim *SessionInterestManager) InterestedSessions(blks []auth.Want, haves []auth.Want, dontHaves []auth.Want) []uint64

When the SessionManager receives a message it calls InterestedSessions() to find out which sessions are interested in the message.

func (*SessionInterestManager) RecordSessionInterest

func (sim *SessionInterestManager) RecordSessionInterest(ses uint64, ks []auth.Want)

When the client asks the session for blocks, the session calls RecordSessionInterest() with those cids.

func (*SessionInterestManager) RemoveSession

func (sim *SessionInterestManager) RemoveSession(ses uint64) []auth.Want

When the session shuts down it calls RemoveSessionInterest(). Returns the keys that no session is interested in any more.

func (*SessionInterestManager) RemoveSessionInterested

func (sim *SessionInterestManager) RemoveSessionInterested(ses uint64, ws []auth.Want) []auth.Want

When a request is cancelled, the session calls RemoveSessionInterested(). Returns the keys that no session is interested in any more.

func (*SessionInterestManager) RemoveSessionWants

func (sim *SessionInterestManager) RemoveSessionWants(ses uint64, ks []auth.Want)

When the session receives blocks, it calls RemoveSessionWants().

func (*SessionInterestManager) SplitWantedUnwanted

func (sim *SessionInterestManager) SplitWantedUnwanted(blks []auth.AuthBlock) ([]auth.AuthBlock, []auth.AuthBlock)

When bitswap receives blocks it calls SplitWantedUnwanted() to discard unwanted blocks

Jump to

Keyboard shortcuts

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