This section is empty.


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


This section is empty.


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

          Source Files