pop method
Implementation
Future<int> pop() async {
if (_currentList.isEmpty && !closed) {
// wait until data is available (busy waiting... how sad...)
while (await Future<bool>.delayed(
const Duration(milliseconds: 100), () => _currentList.isEmpty) &&
!closed) {}
}
return _currentList.removeAt(0);
}