code: func (b *Butler) shutdown(err error) {
  	log.Fields{
  		log.ErrorKey: err,
  	}.Debugf(b.ctx, "Received 'shutdown()' command; shutting down streams.")
  
  	func() {
  		b.shutdownMu.Lock()
  		defer b.shutdownMu.Unlock()
  
  		if b.isShutdown {
  			// Already shut down.
  			return
  		}
  
  		// Signal our streams to shutdown prematurely.
  		close(b.streamStopC)
  
  		b.runErr = err
  		b.isShutdown = true
  	}()
  
  	// Activate the Butler, if it hasn't already been activated. The Butler will
  	// block pending stream draining, but we've instructed our streams to
  	// shutdown prematurely, so this should be reasonably quick.
  	b.Activate()
  }
docs: // shutdown is a goroutine-safe method instructing the Butler to terminate
  // with the supplied error code. It may be called more than once, although
  // the first supplied error message will be the one returned by Run.