package
Version:
v0.1.7
Opens a new window with list of versions in this module.
Published: May 2, 2024
License: MPL-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Broker[T any] struct {
}
Broker allows clients to publish events and subscribe to events
NewBroker constructs a pub/sub broker.
Publish an event to subscribers.
func (b *Broker[T]) Shutdown()
Shutdown the broker, terminating any subscriptions.
Subscribe subscribes the caller to a stream of events. The returned channel
is closed when the broker is shutdown.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.