Documentation ¶
Index ¶
- type SessionInterestManager
- func (sim *SessionInterestManager) FilterSessionInterested(ses uint64, ksets ...[]cid.Cid) [][]cid.Cid
- func (sim *SessionInterestManager) InterestedSessions(blks []cid.Cid, haves []cid.Cid, dontHaves []cid.Cid) []uint64
- func (sim *SessionInterestManager) RecordSessionInterest(ses uint64, ks []cid.Cid)
- func (sim *SessionInterestManager) RemoveSession(ses uint64) []cid.Cid
- func (sim *SessionInterestManager) RemoveSessionInterested(ses uint64, ks []cid.Cid) []cid.Cid
- func (sim *SessionInterestManager) RemoveSessionWants(ses uint64, ks []cid.Cid)
- func (sim *SessionInterestManager) SplitWantedUnwanted(blks []blocks.Block) ([]blocks.Block, []blocks.Block)
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 (*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 ¶
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