package watch

import "github.com/docker/swarmkit/manager/state/watch"

Index

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.

Source Files

watch.go

Version
v1.12.0 (latest)
Published
Jul 26, 2016
Platform
linux/amd64
Imports
1 packages
Last checked
1 hour ago

Tools for package owners.