sessioninterestmanager

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0, MIT Imports: 3 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

Filters only the 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

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(keySets ...[]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) RemoveSessionWants

func (sim *SessionInterestManager) RemoveSessionWants(ses uint64, ks []cid.Cid) []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