The simplest way to do this may be by dequeueing the object at the front after a specified size is reached. This will maintain a queue of any size.
int counter = 0;
int size = 10;//size of queue
if(counter < size){
//Enqueue
counter += 1
}
else{
//Enqueue
//Dequeue
}