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 `json:"num_subscriptions"` NumCache uint32 `json:"num_cache"` NumInserts uint64 `json:"num_inserts"` NumRemoves uint64 `json:"num_removes"` NumMatches uint64 `json:"num_matches"` CacheHitRate float64 `json:"cache_hit_rate"` MaxFanout uint32 `json:"max_fanout"` AvgFanout float64 `json:"avg_fanout"` StatsTime time.Time `json:"stats_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.