Add read callback

Read callback is used to flush with strict interval.
Fix not allocating yajl handle after flush.