Documentation
¶
Overview ¶
Package event provides a lightweight in-process event bus and queue, modeled on kitex's pkg/event. It decouples producers from consumers: for example, a service-discovery cache can dispatch a "discovery.change" event that a circuit-breaker suite subscribes to in order to evict state for removed instances.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface {
// Watch registers cb for events named name.
Watch(name string, cb Callback)
// Unwatch removes a previously registered cb.
Unwatch(name string, cb Callback)
// Dispatch delivers e to all callbacks watching its name.
Dispatch(e *Event)
}
Bus dispatches named events to registered callbacks.
Click to show internal directories.
Click to hide internal directories.