Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventHandler ¶
type EventHandler = internal.EventHandler
type Eventbus ¶
type Eventbus interface {
// Close closes the eventbus.
Close() error
// Publish publishes an event.
Publish(ctx context.Context, topic string, message any) error
// Subscribe subscribes to an event.
Subscribe(ctx context.Context, topic string, handler EventHandler, balance ...bool) (Subscription, error)
}
type Subscription ¶ added in v2.6.0
type Subscription interface {
// Unsubscribe cancels the subscription.
Unsubscribe(ctx context.Context) error
}
func Subscribe ¶
func Subscribe(ctx context.Context, topic string, handler EventHandler, balance ...bool) (Subscription, error)
Subscribe subscribes to an event.
Click to show internal directories.
Click to hide internal directories.