Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Awaiter ¶
type Awaiter 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) Once ¶
func (a Awaiter) Once(ctx context.Context, names ...string) (<-chan event.Event, <-chan error, error)
Once subscribes to the given events over the event bus and returns a channel for the event and an error channel. The returned Event channels will never receive more than one element (either a single Event or a single error). When an Event or an error is received, both channels are immediately closed.
If len(names) == 0, Once returns nil channels.
Click to show internal directories.
Click to hide internal directories.