/
worker.go
29 lines (23 loc) · 1.05 KB
/
worker.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package worker
import (
"github.com/taskcluster/taskcluster/v44/tools/worker-runner/run"
"github.com/taskcluster/taskcluster/v44/tools/workerproto"
)
// Worker is responsible for determining the identity of this worker and gathering
// Takcluster credentials.
type Worker interface {
// Configure the given state. This is expected to set the Taskcluster deployment
// and worker-information fields, but may modify any part of the state it desires.
ConfigureRun(state *run.State) error
// In a subsequent run with cacheOverRestarts set, this method is called
// instead of ConfigureRun. It should recover any worker state required
// from the given Run.
UseCachedRun(run *run.State) error
// Actually start the worker, returning once it has been started.
StartWorker(state *run.State) (workerproto.Transport, error)
// Set the protocol used for communication with this worker. This is an appropriate
// time to register for interesting messages from the worker.
SetProtocol(proto *workerproto.Protocol)
// Wait for the worker to terminate
Wait() error
}