code: func (sub *Subscription) Unsubscribe() {
  	sub.unsubOnce.Do(func() {
  	uninstallLoop:
  		for {
  			// write uninstall request and consume logs/hashes. This prevents
  			// the eventLoop broadcast method to deadlock when writing to the
  			// filter event channel while the subscription loop is waiting for
  			// this method to return (and thus not reading these events).
  			select {
  			case sub.es.uninstall <- sub.f:
  				break uninstallLoop
  			case <-sub.f.logs:
  			case <-sub.f.hashes:
  			case <-sub.f.headers:
  			}
  		}
  
  		// wait for filter to be uninstalled in work loop before returning
  		// this ensures that the manager won't use the event channel which
  		// will probably be closed by the client asap after this method returns.
  		<-sub.Err()
  	})
  }
docs: // Unsubscribe uninstalls the subscription from the event broadcast loop.