Documentation ¶
Overview ¶
Sublist is a subject distribution data structure that can match subjects to interested subscribers. Subscribers can have wildcard subjects to match multiple published subjects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSubject = errors.New("Invalid Subject") ErrNotFound = errors.New("No Matches Found") )
Functions ¶
func IsValidLiteralSubject ¶
Types ¶
type Stats ¶
type Stats struct { NumSubs uint32 NumCache uint32 NumInserts uint64 NumRemoves uint64 NumMatches uint64 CacheHitRate float64 MaxFanout uint32 AvgFanout float64 StatsTime time.Time }
Stats for the sublist
type Sublist ¶
type Sublist struct {
// contains filtered or unexported fields
}
A Sublist stores and efficiently retrieves subscriptions. It uses a tree structure and an efficient RR cache to achieve quick lookups.
func (*Sublist) Match ¶
Match will match all entries to the literal subject. It will return a slice of results.
func (*Sublist) Remove ¶
Remove will remove any item associated with key. It will track descent into the trie and prune upon successful removal.
func (*Sublist) ResetStats ¶
func (s *Sublist) ResetStats()
ResetStats will clear stats and update StatsTime to time.Now()
Click to show internal directories.
Click to hide internal directories.