tcworkermanagerevents

package
v17.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

These exchanges provide notifications when a worker pool is created or updated.This is so that the provisioner running in a differentprocess at the other end can synchronize to the changes. But you are ofcourse welcome to use these for other purposes, monitoring changes for example.

See:

How to use this package

This package is designed to sit on top of http://godoc.org/github.com/taskcluster/pulse-go/pulse. Please read the pulse package overview to get an understanding of how the pulse client is implemented in go.

This package provides two things in addition to the basic pulse package: structured types for unmarshaling pulse message bodies into, and custom Binding interfaces, for defining the fixed strings for task cluster exchange names, and routing keys as structured types.

For example, when specifying a binding, rather than using:

pulse.Bind(
	"*.*.*.*.*.*.gaia.#",
	"exchange/taskcluster-queue/v1/task-defined",
)

You can rather use:

queueevents.TaskDefined{WorkerType: "gaia"}

In addition, this means that you will also get objects in your callback method like *queueevents.TaskDefinedMessage rather than just interface{}.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkerPoolCreated

type WorkerPoolCreated struct {
	RoutingKeyKind string `mwords:"*"`
	Reserved       string `mwords:"#"`
}

Whenever the api receives a request to create aworker pool, a message is posted to this exchange anda provider can act upon it.

See #workerPoolCreated

func (WorkerPoolCreated) ExchangeName

func (binding WorkerPoolCreated) ExchangeName() string

func (WorkerPoolCreated) NewPayloadObject

func (binding WorkerPoolCreated) NewPayloadObject() interface{}

func (WorkerPoolCreated) RoutingKey

func (binding WorkerPoolCreated) RoutingKey() string

type WorkerPoolUpdated

type WorkerPoolUpdated struct {
	RoutingKeyKind string `mwords:"*"`
	Reserved       string `mwords:"#"`
}

Whenever the api receives a request to update aworker pool, a message is posted to this exchange anda provider can act upon it.

See #workerPoolUpdated

func (WorkerPoolUpdated) ExchangeName

func (binding WorkerPoolUpdated) ExchangeName() string

func (WorkerPoolUpdated) NewPayloadObject

func (binding WorkerPoolUpdated) NewPayloadObject() interface{}

func (WorkerPoolUpdated) RoutingKey

func (binding WorkerPoolUpdated) RoutingKey() string

type WorkerTypePulseMessage

type WorkerTypePulseMessage struct {

	// If this is defined, it was the provider that handled this worker pool in the
	// configuration before the current one. This will be used by providers to clean
	// up any resources created for this workerType when they are no longer responsible
	// for it.
	//
	// Syntax:     ^([a-zA-Z0-9-_]*)$
	// Min length: 1
	// Max length: 38
	PreviousProviderID string `json:"previousProviderId,omitempty"`

	// The provider responsible for managing this worker pool.
	//
	// If this value is `"null-provider"`, then the worker pool is pending deletion
	// once all existing workers have terminated.
	//
	// Syntax:     ^([a-zA-Z0-9-_]*)$
	// Min length: 1
	// Max length: 38
	ProviderID string `json:"providerId"`

	// The ID of this worker pool (of the form `providerId/workerType` for compatibility)
	//
	// Syntax:     ^[a-zA-Z0-9-_]{1,38}/[a-z]([-a-z0-9]{0,36}[a-z0-9])?$
	WorkerPoolID string `json:"workerPoolId"`
}

The message that is emitted when worker pools are created/changed/deleted.

Jump to

Keyboard shortcuts

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