watch

package
v0.0.0-...-120fae7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: Apache-2.0 Imports: 2 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() *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) Close

func (q *Queue) Close() error

Close closes the queue and frees the associated resources.

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