Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Awaiter ¶
type Awaiter[D any] struct { // contains filtered or unexported fields }
Awaiter can be used to await events in more complex scenarios.
func NewAwaiter ¶
NewAwaiter returns an Awaiter for the given Bus.
func (Awaiter[D]) Once ¶
func (a Awaiter[D]) Once(ctx context.Context, names ...string) (<-chan event.Of[D], <-chan error, error)
Once subscribes to the given events. After the first received event, the subscription is canceled, so that the returned event and error channels will never receive more than one event or one error, respectively.
If len(names) == 0, Once returns nil channels.
Click to show internal directories.
Click to hide internal directories.