watch

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is the structure used to publish events and watch for them.

func NewQueue

func NewQueue(buffer int) *Queue

NewQueue creates a new publish/subscribe queue which supports watchers. The channels that it will create for subscriptions will have the buffer size specified by buffer.

func (*Queue) CallbackWatch

func (q *Queue) CallbackWatch(matcher events.Matcher) (eventq chan events.Event, cancel func())

CallbackWatch returns a channel which will receive all events published to the queue from this point that pass the check in the provided callback function. The returned cancel function will stop the flow of events and close the channel.

func (*Queue) Publish

func (q *Queue) Publish(item events.Event)

Publish adds an item to the queue.

func (*Queue) Watch

func (q *Queue) Watch() (eventq chan events.Event, cancel func())

Watch returns a channel which will receive all items published to the queue from this point, until cancel is called.

Jump to

Keyboard shortcuts

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