예제 #1
0
파일: worker.go 프로젝트: atmos/conveyor
// New returns a new Worker instance and subscribes to receive build
// requests from the BuildQueue.
func New(c Conveyor, options Options) *Worker {
	return &Worker{
		Conveyor:      c,
		Builder:       builder.WithCancel(options.Builder),
		buildRequests: options.BuildRequests,
		shutdown:      make(chan struct{}),
		done:          make(chan error),
	}
}
예제 #2
0
파일: worker.go 프로젝트: russ/conveyor
// NewWorker returns a new Worker instance and subscribes to receive build
// requests from the BuildQueue.
func NewWorker(options WorkerOptions) *Worker {
	return &Worker{
		Builder:       builder.WithCancel(options.Builder),
		LogFactory:    options.LogFactory,
		buildRequests: options.BuildRequests,
		shutdown:      make(chan struct{}),
		done:          make(chan error),
	}
}
예제 #3
0
// New returns a new Conveyor instance.
func New(b builder.Builder) *Conveyor {
	return &Conveyor{
		Builder: builder.WithCancel(builder.CloseWriter(b)),
		Timeout: DefaultTimeout,
	}
}