Simple queue implemented with closure