Documentation ¶
Index ¶
- type PeerManagerFactory
- type RequestSplitterFactory
- type Session
- type SessionFactory
- type SessionManager
- func (sm *SessionManager) GetNextSessionID() uint64
- func (sm *SessionManager) IsWanted(cid cid.Cid) bool
- func (sm *SessionManager) NewSession(ctx context.Context, provSearchDelay time.Duration, rebroadcastDelay delay.D) exchange.Fetcher
- func (sm *SessionManager) ReceiveFrom(from peer.ID, ks []cid.Cid)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerManagerFactory ¶
type PeerManagerFactory func(ctx context.Context, id uint64) bssession.PeerManager
PeerManagerFactory generates a new peer manager for a session.
type RequestSplitterFactory ¶
type RequestSplitterFactory func(ctx context.Context) bssession.RequestSplitter
RequestSplitterFactory generates a new request splitter for a session.
type SessionFactory ¶
type SessionFactory func(ctx context.Context, id uint64, pm bssession.PeerManager, srs bssession.RequestSplitter, notif notifications.PubSub, provSearchDelay time.Duration, rebroadcastDelay delay.D) Session
SessionFactory generates a new session for the SessionManager to track.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is responsible for creating, managing, and dispatching to sessions.
func New ¶
func New(ctx context.Context, sessionFactory SessionFactory, peerManagerFactory PeerManagerFactory, requestSplitterFactory RequestSplitterFactory, notif notifications.PubSub) *SessionManager
New creates a new SessionManager.
func (*SessionManager) GetNextSessionID ¶
func (sm *SessionManager) GetNextSessionID() uint64
GetNextSessionID returns the next sequentional identifier for a session.
func (*SessionManager) IsWanted ¶
func (sm *SessionManager) IsWanted(cid cid.Cid) bool
IsWanted indicates whether any of the sessions are waiting to receive the block with the given CID.
func (*SessionManager) NewSession ¶
func (sm *SessionManager) NewSession(ctx context.Context, provSearchDelay time.Duration, rebroadcastDelay delay.D) exchange.Fetcher
NewSession initializes a session with the given context, and adds to the session manager.
func (*SessionManager) ReceiveFrom ¶
func (sm *SessionManager) ReceiveFrom(from peer.ID, ks []cid.Cid)
ReceiveFrom receives block CIDs from a peer and dispatches to sessions.