add Buffer class and callback in eventloop