code: func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error) {
  	notifier, supported := rpc.NotifierFromContext(ctx)
  	if !supported {
  		return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
  	}
  
  	rpcSub := notifier.CreateSubscription()
  
  	go func() {
  		txHashes := make(chan []common.Hash, 128)
  		pendingTxSub := api.events.SubscribePendingTxs(txHashes)
  
  		for {
  			select {
  			case hashes := <-txHashes:
  				// To keep the original behaviour, send a single tx hash in one notification.
  				// TODO(rjl493456442) Send a batch of tx hashes in one notification
  				for _, h := range hashes {
  					notifier.Notify(rpcSub.ID, h)
  				}
  			case <-rpcSub.Err():
  				pendingTxSub.Unsubscribe()
  				return
  			case <-notifier.Closed():
  				pendingTxSub.Unsubscribe()
  				return
  			}
  		}
  	}()
  
  	return rpcSub, nil
  }
docs: // NewPendingTransactions creates a subscription that is triggered each time a transaction
  // enters the transaction pool and was signed from one of the transactions this nodes manages.