[ https://issues.apache.org/jira/browse/GROOVY-11650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949310#comment-17949310 ]
ASF GitHub Bot commented on GROOVY-11650: ----------------------------------------- daniellansun commented on PR #2212: URL: https://github.com/apache/groovy/pull/2212#issuecomment-2849336900 +1 > Create drain extension method for Queues > ---------------------------------------- > > Key: GROOVY-11650 > URL: https://issues.apache.org/jira/browse/GROOVY-11650 > Project: Groovy > Issue Type: New Feature > Reporter: Paul King > Assignee: Paul King > Priority: Major > Fix For: 5.x > > > The standard iterator for queues like PriorityQueue don't iterate according > to priority order. You have to use poll (or drainTo for blocking queues) to > get the elements in priority order. It would be useful to have a "drain()" or > "elements()" method to get a list of all the elements that successive calls > to poll would return. The intention would be that the queue was drained upon > completion of the call. -- This message was sent by Atlassian Jira (v8.20.10#820010)