Documentation ¶
Index ¶
- Variables
- func Simulate(c *Config, size int, pubs int, subs int, logStdOut bool) map[string]float64
- type Config
- type Node
- func (n *Node) Publish(topic []byte, message []byte)
- func (n *Node) Start()
- func (n *Node) Stop()
- func (n *Node) Subscribe(topic []byte, receiver io.Writer)
- func (n *Node) SubscribeDigest(digest *sha256digest, receiver io.Writer)
- func (n *Node) Subscribed(topic []byte) bool
- func (n *Node) SubscribedDigest(digest *sha256digest) bool
- func (n *Node) Subscribers(topic []byte) []io.Writer
- func (n *Node) Unsubscribe(topic []byte, receiver io.Writer)
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardConfig = Config{
DefaultEventTTL: 64,
FilterFreshness: 50000,
PropagationDelay: 20000,
HistoryLimit: 1048576,
HistoryAccuracy: 1.0 / 1048576.0,
FiltersDepth: 8,
FiltersM: 10240,
FiltersK: 7,
}
StandardConfig uses well agreed upon values, only deviate for testing.
Functions ¶
Types ¶
type Config ¶
type Config struct { DefaultEventTTL uint32 // decremented every hop FilterFreshness uint64 // in ms (older filters ignored) PropagationDelay uint64 // in ms (when filters sent to peers) HistoryLimit uint32 // nr of event entries probably remembered HistoryAccuracy float64 // false positive chance between 0.0 and 1.0 FiltersDepth uint32 // attenuated bloom filter depth FiltersM uint64 // bloom filter m bits (multiple of 64) FiltersK uint64 // bloom filter k hashes }
Config for a quasar node.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node holds the quasar pubsup state
func (*Node) SubscribeDigest ¶
Subscribe provided message receiver to given topic digest.
func (*Node) Subscribed ¶
Subscribed returns true if node is subscribed to given topic.
func (*Node) SubscribedDigest ¶
Subscribed returns true if node is subscribed to given topic digest.
func (*Node) Subscribers ¶
Subscribers retruns message receivers for given topic.
Click to show internal directories.
Click to hide internal directories.