code: func NewSubscription(producer func(<-chan struct{}) error) Subscription {
  	s := &funcSub{unsub: make(chan struct{}), err: make(chan error, 1)}
  	go func() {
  		defer close(s.err)
  		err := producer(s.unsub)
  		s.mu.Lock()
  		defer s.mu.Unlock()
  		if !s.unsubscribed {
  			if err != nil {
  				s.err <- err
  			}
  			s.unsubscribed = true
  		}
  	}()
  	return s
  }
docs: // NewSubscription runs a producer function as a subscription in a new goroutine. The
  // channel given to the producer is closed when Unsubscribe is called. If fn returns an
  // error, it is sent on the subscription's error channel.