code: func (api *PublicFilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
  	notifier, supported := rpc.NotifierFromContext(ctx)
  	if !supported {
  		return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
  	}
  
  	rpcSub := notifier.CreateSubscription()
  
  	go func() {
  		headers := make(chan *types.Header)
  		headersSub := api.events.SubscribeNewHeads(headers)
  
  		for {
  			select {
  			case h := <-headers:
  				notifier.Notify(rpcSub.ID, h)
  			case <-rpcSub.Err():
  				headersSub.Unsubscribe()
  				return
  			case <-notifier.Closed():
  				headersSub.Unsubscribe()
  				return
  			}
  		}
  	}()
  
  	return rpcSub, nil
  }
docs: // NewHeads send a notification each time a new (header) block is appended to the chain.