eventer

package
v0.0.0-...-1fdc273 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultSendEventTimeout is the timeout used when publishing events to consumers
	DefaultSendEventTimeout = 2 * time.Second

	// ConsumerGCInterval is the interval at which garbage collection of consumers
	// occures
	ConsumerGCInterval = time.Minute
)

Functions

This section is empty.

Types

type Eventer

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

Eventer is a utility to control broadcast of TaskEvents to multiple consumers. It also implements the TaskEvents func in the DriverPlugin interface so that it can be embedded in a implementing driver struct.

func NewEventer

func NewEventer(ctx context.Context, logger hclog.Logger) *Eventer

NewEventer returns an Eventer with a running event loop that can be stopped by closing the given stop channel

func (*Eventer) EmitEvent

func (e *Eventer) EmitEvent(event *drivers.TaskEvent) error

EmitEvent can be used to broadcast a new event

func (*Eventer) TaskEvents

func (e *Eventer) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

TaskEvents is an implementation of the DriverPlugin.TaskEvents function

Jump to

Keyboard shortcuts

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