Iterates over the queue and invokes the given action on each reference.
This is intended for diagnostic purposes.