Hi Azat
The behaviour of my program:
1. one thread produce messages , put it in an queue. if queue size change from 0 to 1, write one byte notify message.
2. the libevent event loop(another thread) receive the notify message, begin to invoke notify callback:
  1. drain some messages from the queue
  2. bufferevent_write to write message.
3. write callback
  1. if output buffer size of bufferevent is > 0 ,return
  2.Âdrain some messages from the queue(if any)
  3. bufferevent_write to write message.