github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/worker/finishedworker.go (about)

     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 }