eventer

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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