multiqueue: add buffering support