sessioninterestmanager

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0, MIT Imports: 3 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 ...[]cid.Cid) [][]cid.Cid

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 []cid.Cid, haves []cid.Cid, dontHaves []cid.Cid) []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 []cid.Cid)

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

func (*SessionInterestManager) RemoveSession

func (sim *SessionInterestManager) RemoveSession(ses uint64) []cid.Cid

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, ks []cid.Cid) []cid.Cid

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 []cid.Cid)

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

func (*SessionInterestManager) SplitWantedUnwanted

func (sim *SessionInterestManager) SplitWantedUnwanted(blks []blocks.Block) ([]blocks.Block, []blocks.Block)

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