sessioninterestmanager

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) FilterInterests added in v0.27.3

func (sim *SessionInterestManager) FilterInterests(keySets ...[]cid.Cid) [][]cid.Cid

FilterInterests keeps only keys that are wanted by at least one session.

IMPORTANT: FilterInterests filters the given Cid slices in place, modifying their contents. If the caller needs to preserve a copy of the lists it should make a copy before calling FilterInterests.

func (*SessionInterestManager) FilterSessionInterested

func (sim *SessionInterestManager) FilterSessionInterested(ses uint64, ksets ...[]cid.Cid) [][]cid.Cid

FilterSessionInterested is called by the session to filter the sets of keys for those that the session is interested in.

func (*SessionInterestManager) InterestedSessions

func (sim *SessionInterestManager) InterestedSessions(keySets ...[]cid.Cid) []uint64

InterestedSessions returns a list of sessions that are interested in any of the CIDs in the given sets of CIDs. This is called when SessionManager receives a message, to find out which sessions are interested in the message.

func (*SessionInterestManager) RecordSessionInterest

func (sim *SessionInterestManager) RecordSessionInterest(ses uint64, ks []cid.Cid)

RecordSessionInteres records CIDs that a session is interested in. This is called when the client asks the session for blocks.

func (*SessionInterestManager) RemoveSession

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

RemoveSession removes the keys that no session is interested in any more. This is called when the session shuts down.

func (*SessionInterestManager) RemoveSessionWants

func (sim *SessionInterestManager) RemoveSessionWants(ses uint64, ks []cid.Cid) []cid.Cid

RemoveSessionWants is called when the session receives blocks, to remove the session's interest in CIDs.

func (*SessionInterestManager) SplitWantedUnwanted

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

SplitWantedUnwanted is called when bitswap receives blocks, to discard unwanted blocks.

Jump to

Keyboard shortcuts

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