Queue and flow management system