code: func (ctx *BatchedContext) Run(errChan chan error) error {
  	runtime.LockOSThread()
  	defer runtime.UnlockOSThread()
  	for {
  		select {
  		case <-ctx.workAvailable:
  			ctx.DoWork()
  			if err := ctx.Errors(); err != nil {
  				if errChan == nil {
  					return err
  				}
  				errChan <- err
  
  			}
  		case w := <-ctx.Work():
  			ctx.ErrChan() <- w()
  		}
  	}
  }
docs: // Run manages the running of the BatchedContext. Because it's expected to run in a goroutine, an error channel is to be passed in