truncate, flush && poll support

added missing truncate, flush && poll callbacks.

if you want i can remove commit aa1393c (rm trailing spaces) and make a new pull request.