~nskaggs/+junk/juju-packaging-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/worker/finishedworker.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-27 20:23:11 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161027202311-sux4jk2o73p1d6rg
Re-add src

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package worker
 
5
 
 
6
// FinishedWorker is a worker that stops immediately with no error
 
7
// when started by a Runner, which then removes it from the list of
 
8
// workers without restarting it. Simply return FinishedWorker{}
 
9
// where you need to avoid starting a worker at all.
 
10
type FinishedWorker struct{}
 
11
 
 
12
// Kill implements Worker.Kill() and does nothing.
 
13
func (w FinishedWorker) Kill() {}
 
14
 
 
15
// Wait implements Worker.Wait() and immediately returns no error.
 
16
func (w FinishedWorker) Wait() error { return nil }