use a queue as buffer