code: func (wc *WhisperClient) SubscribeMessages(ctx *Context, criteria *Criteria, handler NewMessageHandler, buffer int) (*Subscription, error) {
  	// Subscribe to the event internally
  	ch := make(chan *whisper.Message, buffer)
  	rawSub, err := wc.client.SubscribeMessages(ctx.context, *criteria.criteria, ch)
  	if err != nil {
  		return nil, err
  	}
  	// Start up a dispatcher to feed into the callback
  	go func() {
  		for {
  			select {
  			case message := <-ch:
  				handler.OnNewMessage(&Message{message})
  
  			case err := <-rawSub.Err():
  				if err != nil {
  					handler.OnError(err.Error())
  				}
  				return
  			}
  		}
  	}()
  	return &Subscription{rawSub}, nil
  }
docs: // SubscribeMessages subscribes to messages that match the given criteria. This method
  // is only supported on bi-directional connections such as websockets and IPC.
  // NewMessageFilter uses polling and is supported over HTTP.