utils

package
v0.0.0-...-e43f319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventWaiter

type EventWaiter struct {
	// contains filtered or unexported fields
}

EventWaiter waits for certain events to match a criteria.

func NewEventWaiter

func NewEventWaiter() *EventWaiter

NewEventWaiter returns a new EventWaiter.

func (*EventWaiter) Notify

func (w *EventWaiter) Notify(ctx context.Context, event eh.Event) error

Notify implements the eventhorizon.EventObserver.Notify method which forwards events to the waiters so that they can match the events.

func (*EventWaiter) Wait

func (w *EventWaiter) Wait(ctx context.Context, match func(eh.Event) bool) (eh.Event, error)

Wait waits unil the match function returns true for an event, or the context deadline expires. The match function can be used to filter or otherwise select interesting events by analysing the event data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL