code: func (c *Channel) OnRead(f OnReadFunc) {
  	// Create a new read handler for this channel.
  	// Previous handlers are stopped first.
  	handlerStopped := c.readHandler.New()
  
  	// Start the handler goroutine.
  	go func() {
  		for {
  			select {
  			case data := <-c.readChan:
  				// Call the callback in a new goroutine.
  				go func() {
  					// Recover panics and log the error.
  					defer func() {
  						if e := recover(); e != nil {
  							log.L.Errorf("glue: panic while calling onRead function: %v\n%s", e, debug.Stack())
  						}
  					}()
  
  					// Trigger the on read event function.
  					f(data)
  				}()
  			case <-c.s.isClosedChan:
  				// Release this goroutine if the socket is closed.
  				return
  			case <-handlerStopped:
  				// Release this goroutine.
  				return
  			}
  		}
  	}()
  }
docs: // OnRead sets the function which is triggered if new data is received on the channel.
  // If this event function based method of reading data from the socket is used,
  // then don't use the socket Read method.
  // Either use the OnRead or the Read approach.