Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus is the default in-memory implementation of event.Bus. It is safe for concurrent use.
func New ¶
New returns a Bus with the default slow-subscriber policy. chCap is the per-subscription channel capacity.
func NewWithPolicy ¶
func NewWithPolicy(chCap int, p SlowPolicy) *Bus
NewWithPolicy returns a Bus with the given policy.
type SlowPolicy ¶
type SlowPolicy struct {
// DropThreshold is the number of consecutive dropped events after
// which the subscription is forcibly closed. Zero means "never close".
DropThreshold int
}
SlowPolicy controls how the bus reacts to slow subscribers.
Click to show internal directories.
Click to hide internal directories.