code: func (link *ToxicLink) RemoveToxic(toxic *toxics.ToxicWrapper) {
  	i := toxic.Index
  
  	if link.stubs[i].InterruptToxic() {
  		cleanup, ok := toxic.Toxic.(toxics.CleanupToxic)
  		if ok {
  			cleanup.Cleanup(link.stubs[i])
  			// Cleanup could have closed the stub.
  			if link.stubs[i].Closed() {
  				return
  			}
  		}
  
  		stop := make(chan bool)
  		// Interrupt the previous toxic to update its output
  		go func() {
  			stop <- link.stubs[i-1].InterruptToxic()
  		}()
  
  		// Unblock the previous toxic if it is trying to flush
  		// If the previous toxic is closed, continue flusing until we reach the end.
  		interrupted := false
  		stopped := false
  		for !interrupted {
  			select {
  			case interrupted = <-stop:
  				stopped = true
  			case tmp := <-link.stubs[i].Input:
  				if tmp == nil {
  					link.stubs[i].Close()
  					if !stopped {
  						<-stop
  					}
  					return
  				}
  				link.stubs[i].Output <- tmp
  			}
  		}
  
  		// Empty the toxic's buffer if necessary
  		for len(link.stubs[i].Input) > 0 {
  			tmp := <-link.stubs[i].Input
  			if tmp == nil {
  				link.stubs[i].Close()
  				return
  			}
  			link.stubs[i].Output <- tmp
  		}
  
  		link.stubs[i-1].Output = link.stubs[i].Output
  		link.stubs = append(link.stubs[:i], link.stubs[i+1:]...)
  
  		go link.stubs[i-1].Run(link.toxics.chain[link.direction][i-1])
  	}
  }
docs: // Remove an existing toxic from the chain.