// 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), } }
// 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), } }
// New returns a new Conveyor instance. func New(b builder.Builder) *Conveyor { return &Conveyor{ Builder: builder.WithCancel(builder.CloseWriter(b)), Timeout: DefaultTimeout, } }