It would it be nice to port `queue.truncate` function from the stable branch to the current master.